cucumber feature for user authentication.
This commit is contained in:
parent
dc97c852f4
commit
e282abd526
3 changed files with 40 additions and 14 deletions
30
Gemfile.lock
30
Gemfile.lock
|
|
@ -115,7 +115,6 @@ GEM
|
||||||
activesupport (= 3.0.1)
|
activesupport (= 3.0.1)
|
||||||
activesupport (3.0.1)
|
activesupport (3.0.1)
|
||||||
addressable (2.2.2)
|
addressable (2.2.2)
|
||||||
archive-tar-minitar (0.5.2)
|
|
||||||
arel (1.0.1)
|
arel (1.0.1)
|
||||||
activesupport (~> 3.0.0)
|
activesupport (~> 3.0.0)
|
||||||
aws (2.3.24)
|
aws (2.3.24)
|
||||||
|
|
@ -141,6 +140,7 @@ GEM
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
selenium-webdriver (>= 0.0.3)
|
selenium-webdriver (>= 0.0.3)
|
||||||
|
cgi_multipart_eof_fix (2.5.0)
|
||||||
chef (0.9.12)
|
chef (0.9.12)
|
||||||
bunny (>= 0.6.0)
|
bunny (>= 0.6.0)
|
||||||
erubis
|
erubis
|
||||||
|
|
@ -192,8 +192,10 @@ GEM
|
||||||
addressable (~> 2.2.2)
|
addressable (~> 2.2.2)
|
||||||
multipart-post (~> 1.0.1)
|
multipart-post (~> 1.0.1)
|
||||||
rack (>= 1.1.0, < 2)
|
rack (>= 1.1.0, < 2)
|
||||||
|
fastthread (1.0.7)
|
||||||
ffi (0.6.3)
|
ffi (0.6.3)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
|
gem_plugin (0.2.3)
|
||||||
gherkin (2.2.9)
|
gherkin (2.2.9)
|
||||||
json (~> 1.4.6)
|
json (~> 1.4.6)
|
||||||
term-ansicolor (~> 1.0.5)
|
term-ansicolor (~> 1.0.5)
|
||||||
|
|
@ -209,8 +211,7 @@ GEM
|
||||||
launchy (0.3.7)
|
launchy (0.3.7)
|
||||||
configuration (>= 0.0.5)
|
configuration (>= 0.0.5)
|
||||||
rake (>= 0.8.1)
|
rake (>= 0.8.1)
|
||||||
linecache19 (0.5.11)
|
linecache (0.43)
|
||||||
ruby_core_source (>= 0.1.4)
|
|
||||||
mail (2.2.9)
|
mail (2.2.9)
|
||||||
activesupport (>= 2.3.6)
|
activesupport (>= 2.3.6)
|
||||||
i18n (~> 0.4.1)
|
i18n (~> 0.4.1)
|
||||||
|
|
@ -232,6 +233,11 @@ GEM
|
||||||
moneta (0.6.0)
|
moneta (0.6.0)
|
||||||
mongo (1.1)
|
mongo (1.1)
|
||||||
bson (>= 1.0.5)
|
bson (>= 1.0.5)
|
||||||
|
mongrel (1.1.5)
|
||||||
|
cgi_multipart_eof_fix (>= 2.4)
|
||||||
|
daemons (>= 1.0.3)
|
||||||
|
fastthread (>= 1.0.1)
|
||||||
|
gem_plugin (>= 0.2.3)
|
||||||
multi_json (0.0.4)
|
multi_json (0.0.4)
|
||||||
multipart-post (1.0.1)
|
multipart-post (1.0.1)
|
||||||
net-ldap (0.1.1)
|
net-ldap (0.1.1)
|
||||||
|
|
@ -326,19 +332,14 @@ GEM
|
||||||
rspec-expectations (~> 2.0.1)
|
rspec-expectations (~> 2.0.1)
|
||||||
rspec-rails (2.0.1)
|
rspec-rails (2.0.1)
|
||||||
rspec (~> 2.0.0)
|
rspec (~> 2.0.0)
|
||||||
ruby-debug-base19 (0.11.24)
|
ruby-debug (0.10.3)
|
||||||
columnize (>= 0.3.1)
|
columnize (>= 0.1)
|
||||||
linecache19 (>= 0.5.11)
|
ruby-debug-base (~> 0.10.3.0)
|
||||||
ruby_core_source (>= 0.1.4)
|
ruby-debug-base (0.10.3)
|
||||||
ruby-debug19 (0.11.6)
|
linecache (>= 0.3)
|
||||||
columnize (>= 0.3.1)
|
|
||||||
linecache19 (>= 0.5.11)
|
|
||||||
ruby-debug-base19 (>= 0.11.19)
|
|
||||||
ruby-openid (2.1.8)
|
ruby-openid (2.1.8)
|
||||||
ruby-openid-apps-discovery (1.2.0)
|
ruby-openid-apps-discovery (1.2.0)
|
||||||
ruby-openid (>= 2.1.7)
|
ruby-openid (>= 2.1.7)
|
||||||
ruby_core_source (0.1.4)
|
|
||||||
archive-tar-minitar (>= 0.5.2)
|
|
||||||
rubyntlm (0.1.1)
|
rubyntlm (0.1.1)
|
||||||
rubyzip (0.9.4)
|
rubyzip (0.9.4)
|
||||||
selenium-client (1.2.18)
|
selenium-client (1.2.18)
|
||||||
|
|
@ -404,6 +405,7 @@ DEPENDENCIES
|
||||||
mini_magick
|
mini_magick
|
||||||
mocha
|
mocha
|
||||||
mongo_mapper!
|
mongo_mapper!
|
||||||
|
mongrel
|
||||||
omniauth
|
omniauth
|
||||||
pubsubhubbub
|
pubsubhubbub
|
||||||
rails (>= 3.0.0)
|
rails (>= 3.0.0)
|
||||||
|
|
@ -411,7 +413,7 @@ DEPENDENCIES
|
||||||
roxml!
|
roxml!
|
||||||
rspec (>= 2.0.0)
|
rspec (>= 2.0.0)
|
||||||
rspec-rails (>= 2.0.0)
|
rspec-rails (>= 2.0.0)
|
||||||
ruby-debug19
|
ruby-debug
|
||||||
sprinkle!
|
sprinkle!
|
||||||
thin
|
thin
|
||||||
twitter
|
twitter
|
||||||
|
|
|
||||||
16
features/logs_in_and_out.feature
Normal file
16
features/logs_in_and_out.feature
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
Feature: user authentication
|
||||||
|
|
||||||
|
Scenario: user logs in
|
||||||
|
Given a user with username "ohai" and password "secret"
|
||||||
|
When I go to the new user session page
|
||||||
|
And I fill in "Username" with "ohai"
|
||||||
|
And I fill in "Password" with "secret"
|
||||||
|
And I press "Sign in"
|
||||||
|
Then I should be on the home page
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: user logs out
|
||||||
|
Given I am signed in
|
||||||
|
And I click on my name in the header
|
||||||
|
And I follow "logout"
|
||||||
|
Then I should be on the new user session page
|
||||||
8
features/step_definitions/user_steps.rb
Normal file
8
features/step_definitions/user_steps.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
Given /^a user with username "([^\"]*)" and password "([^\"]*)"$/ do |username, password|
|
||||||
|
Factory(:user, :username => username, :password => password,
|
||||||
|
:password_confirmation => password, :getting_started => false)
|
||||||
|
end
|
||||||
|
|
||||||
|
When /^I click on my name$/ do
|
||||||
|
click_link("#{@me.first_name} #{@me.last_name}")
|
||||||
|
end
|
||||||
Loading…
Reference in a new issue