forked from saasbook/coursequestionbank
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ingridh/coursequestionbank
- Loading branch information
Showing
7 changed files
with
99 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Given(/^I have selected a file to upload$/) do | ||
page.driver.browser.post('/upload', "myfile" => "test_files/foo.txt") | ||
end | ||
|
||
Given(/^I press the upload button$/) do | ||
click_button "Upload!" | ||
end | ||
|
||
Given(/^the upload fails$/) do | ||
pending # express the regexp above with the code you wish you had | ||
end | ||
|
||
Then(/^I should see a flash message telling me of failure$/) do | ||
pending # express the regexp above with the code you wish you had | ||
end | ||
|
||
Given(/^I successfully upload a file$/) do | ||
pending # express the regexp above with the code you wish you had | ||
end | ||
|
||
Given(/^I press upload without selecting a file$/) do | ||
params["myfile"] = nil | ||
end | ||
|
||
Then(/^I should see a flash message asking me to select a file$/) do | ||
flash[:notice] = "Please select a file" | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
quiz 'A few example questions' do | ||
|
||
choice_answer :randomize => true do | ||
text "Which of the following best identifies the four basic operations supported by RDBMS?" | ||
distractor "HTTP", :explanation => 'HTTP stands for HyperText Transfer Protocol, which is used to transfer SaaS content to browsers.' | ||
distractor "Get, Put, Post, Delete", :explanation => 'These are four of the methods or "verbs" used by HTTP.' | ||
answer "CRUD", :explanation => 'Create, Read, Update, Delete are the four basic database operations commonly performed by SaaS apps.' | ||
distractor "REST", :explanation => 'REpresentational State Transfer is a design approach for making SaaS requests self-contained by having each request refer to a resource and an operation on that resource.' | ||
end | ||
|
||
truefalse 'If an app has a RESTful API, it must be performing CRUD operations.', | ||
false, | ||
:explanation => 'The REST principle can be applied to any kind of operation' | ||
|
||
choice_answer :randomize => true do | ||
text "The implied port number of the URI <tt>http://google.com</tt> is" | ||
answer "80" | ||
distractor "400" | ||
distractor "3000" | ||
distractor "8000" | ||
end | ||
|
||
select_multiple :randomize => true do | ||
text "Which tiers in the three-tier architecture are involved in handling views?" | ||
answer "Presentation" | ||
answer "Logic" | ||
distractor "Persistence" | ||
distractor "Database" | ||
end | ||
|
||
choice_answer :randomize => true do | ||
text "The ----- tier of three-tier SaaS apps is the most complicated to scale." | ||
answer "Presentation" | ||
distractor "Logic" | ||
distractor "Persistence" | ||
distractor "Database" | ||
end | ||
|
||
choice_answer :randomize => true do | ||
text "An HTTP request must consist of both a(n) ----- and a(n) -----" | ||
distractor "CRUD action, database" | ||
distractor "header, cookie", :explanation => 'A header is part of the request, but a cookie is not necessarily included unless the server previously specified one.' | ||
distractor "URL, wildcard", :explanation => 'A URL is necessary, but not a wildcard.' | ||
answer "URI, HTTP request method", :explanation => "The URI alone isn't enough--the same URI used with two different methods can cause two different actions." | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: Upload a RUql file | ||
As an instructor | ||
So that I can add questions | ||
I want to upload a RUql file | ||
|
||
Background: | ||
Given I am signed in with uid "1234" and provider "github" | ||
And I am on the upload page | ||
|
||
Scenario: redirect to login page if not logged in | ||
Given I am not logged in | ||
And I am on the upload page | ||
Then I should be on the login page | ||
|
||
Scenario: upload a file successfully | ||
Given I am on the upload page | ||
And I attach the file "features/test_files/foo.txt" to "file_upload" | ||
And I press the upload button | ||
Then I should see "Success!" | ||
|
||
|
Submodule saasquizes
added at
38ec09