migrate deleting of contexts

This commit is contained in:
Reinier Balt 2010-10-23 17:52:50 +02:00
parent 15fdb1e572
commit e52a8609c7
10 changed files with 124 additions and 31 deletions

View file

@ -3,14 +3,28 @@ Given /^I have no contexts$/ do
Context.delete_all
end
Given /^there exists a context called "([^"]*)" for user "([^"]*)"$/ do |context_name, login|
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.create!(:name => context_name)
@context = user.contexts.create!(:name => context_name, :hide => false)
end
Given /^there exists a hidden context called "([^"]*)" for user "([^"]*)"$/ do |context_name, login|
user = User.find_by_login(login)
user.should_not be_nil
@context = user.contexts.create!(:name => context_name, :hide => true)
end
Given /^I have a context called "([^\"]*)"$/ do |context_name|
Given "there exists a context called \"#{context_name}\" for user \"#{@current_user.login}\""
Given "there exists an active context called \"#{context_name}\" for user \"#{@current_user.login}\""
end
Given /^I have an active context called "([^\"]*)"$/ do |context_name|
Given "there exists an active context called \"#{context_name}\" for user \"#{@current_user.login}\""
end
Given /^I have a hidden context called "([^\"]*)"$/ do |context_name|
Given "there exists a hidden context called \"#{context_name}\" for user \"#{@current_user.login}\""
end
Given /^I have the following contexts:$/ do |table|