This file contains hidden or 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
| # NOT: v2: <https://gist.github.com/3180446> | |
| # v1 | |
| @question_new | |
| Scenario: I should be able to new/create Question | |
| Given I am logged as "author" | |
| And I have "author, osce_author" roles | |
| When I visit the questions list page | |
| And I click link titled "New" in the "Page Header Actions" section | |
| And I fill the form with: |
This file contains hidden or 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
| RSpec.configure do |config| | |
| config.before(:suite) do | |
| ActiveRecord::Base.establish_connection database['one'] | |
| DatabaseCleaner.strategy = :deletion | |
| ActiveRecord::Base.establish_connection config.database['two'] | |
| DatabaseCleaner.strategy = :deletion | |
| end | |
| config.before(:each) do |
This file contains hidden or 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
| # encoding: utf-8 | |
| class User | |
| has_many :questions, foreign_key: 'author_id' | |
| has_many :questions, foreign_key: 'editor_id' | |
| end | |
| class Question | |
| attr_accessible :author, :editor | |
| belongs_to :author, foreign_key: 'author_id', class_name: 'User' |
This file contains hidden or 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
| # encoding: utf-8 | |
| # vim: tabstop=2:softtabstop=2:shiftwidth=2:noexpandtab | |
| Feature: user ... | |
| Scenario Outline: login | |
| Given I visit "/" page | |
| #And I am not logged in | |
| And an user exists with login "<uname>" and password "<pass>" | |
| And I fill in "username" with "<uname2>" | |
| And I fill in "password" with "<pass2>" | |
| When I press "<action>" |
This file contains hidden or 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
| Feature: Forms steps | |
| Steps for various forms interaction | |
| Scenario: Simple form steps | |
| Given I am on the form page | |
| When I fill in "Name" with "my name" | |
| And I fill in "Describe yourself" with: | |
| """ | |
| this usefull |
This file contains hidden or 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
| # http://www.cowboycoded.com/2011/01/05/better-web-steps-for-cucumber-with-capybara/ | |
| class String | |
| def csserize | |
| self.downcase.gsub(" ","-") | |
| end | |
| end | |
| module WithinHelpers | |
| def with_scope(locator,css_type=nil) |
This file contains hidden or 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
| # http://aslakhellesoy.com/post/11055981222/the-training-wheels-came-off | |
| module LoginSteps | |
| def login(name, password) | |
| visit('/login') | |
| fill_in('User name', with: name) | |
| fill_in('Password', with: password) | |
| click_button('Log in') | |
| end | |
| end |
This file contains hidden or 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
| Feature: Sign up | |
| As a site owner | |
| I want users to sign up | |
| So I can establish stronger relationships with my users | |
| Scenario: Sign up | |
| Given I am Fred | |
| When I sign up | |
| Then I should be registered |
This file contains hidden or 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
| Feature: Sign in | |
| As a registered user | |
| I want to sign in | |
| So I can be recognised by the site | |
| Scenario: Sign in | |
| Given I am registered as 'Fred' | |
| When I sign in | |
| Then I should be signed in |