Created
August 4, 2008 16:57
-
-
Save agibralter/3927 to your computer and use it in GitHub Desktop.
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
Given("no Users and no BetaUsers") do | |
User.delete_all | |
BetaUser.delete_all | |
end | |
Given("a User with no login, email '$email', and password '$password'") do |email, password| | |
Factory(:user, :email => email, :login => nil, :password => password, :password_confirmation => password) | |
end | |
Given("a BetaUser '$email'") do |email| | |
@beta_user = Factory(:beta_user, :email => email) | |
end | |
# THIS one breaks my stories! is there something wrong with my post and delete here? | |
Given("a BetaUser '$email' who is no bum") do |email| | |
beta_user = Factory(:beta_user, :email => email) | |
post_via_redirect '/users', :user => {:email => email, :password => 'password', :password_confirmation => 'password'}, :beta_code => beta_user.beta_code | |
delete_via_redirect '/session' | |
end | |
Given("'$login_or_email' logged in with password '$password'") do |login_or_email, password| | |
post '/session', { :login_or_email => login_or_email, :password => password } | |
# require 'ruby-debug' | |
# debugger | |
# response.body is empty!!! WTF | |
response.should be_redirect | |
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
Scenario: An admin viewing the bums only list of beta users | |
Given no Users and no BetaUsers | |
And a User with no login, email '[email protected]', and password 'I like cats' | |
And a BetaUser '[email protected]' | |
And a BetaUser '[email protected]' who is no bum | |
And '[email protected]' logged in with password 'I like cats' (FAILED) # response.body is empty! | |
When that user requests '/admin/beta_users' with bums_only true | |
Then that user should see a list of beta users including '[email protected]' | |
And that user should see a list of beta users not including '[email protected]' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment