mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-30 12:45:18 +01:00
get the first cucumber feature running: calendar
This commit is contained in:
parent
393eae1937
commit
c9d64e6f4b
28 changed files with 400 additions and 418 deletions
|
|
@ -6,7 +6,7 @@ end
|
|||
Given /^there exists an active context called "([^"]*)" for user "([^"]*)"$/ do |context_name, login|
|
||||
user = User.find_by_login(login)
|
||||
user.should_not be_nil
|
||||
@context = user.contexts.find_or_create(:name => context_name, :hide => false)
|
||||
@context = user.contexts.find_or_create_by_name(:name => context_name, :hide => false)
|
||||
end
|
||||
|
||||
Given /^there exists a context called "([^"]*)" for user "([^"]*)"$/ do |context_name, login|
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Given /^I have logged in as "(.*)" with password "(.*)"$/ do |username, password
|
|||
fill_in "Login", :with => username
|
||||
fill_in "Password", :with => password
|
||||
uncheck "Stay logged in:"
|
||||
click_button "Sign in »"
|
||||
click_button "Sign in"
|
||||
|
||||
logout_regexp = @mobile_interface ? "Logout" : "Logout \(#{username}\)"
|
||||
page.should have_content(logout_regexp)
|
||||
|
|
@ -14,7 +14,7 @@ When /^I submit the login form as user "([^\"]*)" with password "([^\"]*)"$/ do
|
|||
fill_in 'Login', :with => username
|
||||
fill_in 'Password', :with => password
|
||||
uncheck "Stay logged in:"
|
||||
click_button "Sign in »"
|
||||
click_button "Sign in"
|
||||
end
|
||||
|
||||
When /^my session expires$/ do
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Given /^I have a todo "([^"]*)" in context "([^"]*)" with tags "([^"]*)"$/ do |d
|
|||
end
|
||||
|
||||
Given /^I have a todo "([^"]*)" in the context "([^"]*)" which is due tomorrow$/ do |description, context_name|
|
||||
context = @current_user.contexts.find_or_create(:name => context_name)
|
||||
context = @current_user.contexts.find_or_create_by_name(context_name)
|
||||
@todo = @current_user.todos.create!(:context_id => context.id, :description => description)
|
||||
@todo.due = @todo.created_at + 1.day
|
||||
@todo.save!
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Given /^the following user records?$/ do |table|
|
||||
User.delete_all
|
||||
table.hashes.each do |hash|
|
||||
user = Factory(:user, hash)
|
||||
user = FactoryGirl.create(:user, hash)
|
||||
user.create_preference({:locale => 'en'})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue