get the first cucumber feature running: calendar

This commit is contained in:
Reinier Balt 2012-04-30 13:51:42 +02:00
parent 393eae1937
commit c9d64e6f4b
28 changed files with 400 additions and 418 deletions

View file

@ -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|

View file

@ -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

View file

@ -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!

View file

@ -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