mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
update cucumber and refactor some of the stories
inspired by the railscasts about cucumber. Also fix a problem with ZenTest on case sensitive platforms
This commit is contained in:
parent
bdddac5020
commit
2073f84cd8
11 changed files with 90 additions and 128 deletions
|
|
@ -1,37 +1,15 @@
|
|||
Given /^the following user records?$/ do |table|
|
||||
table.hashes.each do |hash|
|
||||
user = Factory(:user, hash)
|
||||
user.create_preference
|
||||
end
|
||||
end
|
||||
|
||||
Given "no users exists" do
|
||||
User.delete_all
|
||||
end
|
||||
|
||||
Given "an admin user exists" do
|
||||
if @admin_user
|
||||
@admin_user.destroy
|
||||
end
|
||||
@admin_user = User.create!(:login => 'admin', :password => 'abracadabra', :password_confirmation => 'abracadabra')
|
||||
@admin_user.is_admin = true # is_admin is protected in user model
|
||||
@admin_user.create_preference
|
||||
@admin_user.preference.save
|
||||
@admin_user.save
|
||||
end
|
||||
|
||||
Given "an admin user Reinier with the password abracadabra" do
|
||||
@reinier = User.create!(:login => 'reinier', :password => 'abracadabra', :password_confirmation => 'abracadabra', :is_admin => true)
|
||||
@reinier.create_preference
|
||||
end
|
||||
|
||||
Given "an admin user Reinier" do
|
||||
Given "an admin user Reinier with the password abracadabra"
|
||||
end
|
||||
|
||||
Given "a logged in user Luis" do
|
||||
@luis = User.create!(:login => 'luis', :password => 'sesame', :password_confirmation => 'sesame', :is_admin => false)
|
||||
@luis.create_preference
|
||||
logged_in_as @luis
|
||||
end
|
||||
|
||||
Given "Reinier is not logged in" do
|
||||
#nothing to do
|
||||
end
|
||||
|
||||
Given "a visitor named Reinier" do
|
||||
#nothing to do
|
||||
end
|
||||
Then "I should be an admin" do
|
||||
# just check on the presence of the menu item for managing users
|
||||
Then "I should see \"Manage users\""
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue