fix some tests

This commit is contained in:
Reinier Balt 2010-10-24 23:19:11 +02:00
parent fb39d841a7
commit 8697fd2035
4 changed files with 12 additions and 7 deletions

View file

@ -22,7 +22,7 @@ Feature: Manage the list of contexts
And the badge should show 1 And the badge should show 1
And the context list badge for active contexts should show 1 And the context list badge for active contexts should show 1
@selenium, @wip @selenium
Scenario: Delete last context from context page should remove the contexts container for hidden or active contexts Scenario: Delete last context from context page should remove the contexts container for hidden or active contexts
Given I have a context called "@computer" Given I have a context called "@computer"
And I have a hidden context called "@ipad" And I have a hidden context called "@ipad"
@ -36,7 +36,7 @@ Feature: Manage the list of contexts
Then I should see that a context named "@ipad" is not present Then I should see that a context named "@ipad" is not present
And I should see that the context container for hidden contexts is not present And I should see that the context container for hidden contexts is not present
@selenium, @wip @selenium
Scenario: Delete context from context page right after an edit Scenario: Delete context from context page right after an edit
Given I have a context called "@computer" Given I have a context called "@computer"
When I go to the contexts page When I go to the contexts page
@ -45,7 +45,7 @@ Feature: Manage the list of contexts
Then he should see that a context named "@laptop" is not present Then he should see that a context named "@laptop" is not present
And the badge should show 0 And the badge should show 0
@selenium, @wip @selenium
Scenario: Edit context from context twice Scenario: Edit context from context twice
Given I have a context called "@computer" Given I have a context called "@computer"
When I go to the contexts page When I go to the contexts page

View file

@ -19,8 +19,8 @@ When /^I edit the context to rename it to "([^\"]*)"$/ do |new_name|
selenium.click "submit_context_#{@context.id}", selenium.click "submit_context_#{@context.id}",
:wait_for => :text, :wait_for => :text,
:element => "flash", :text => "Context saved",
:text => "Context saved" :timeout => 5
wait_for do wait_for do
selenium.is_element_present("edit_context_#{@context.id}") selenium.is_element_present("edit_context_#{@context.id}")

View file

@ -9,6 +9,11 @@ Given /^there exists an active context called "([^"]*)" for user "([^"]*)"$/ do
@context = user.contexts.create!(:name => context_name, :hide => false) @context = user.contexts.create!(:name => context_name, :hide => false)
end end
Given /^there exists a context called "([^"]*)" for user "([^"]*)"$/ do |context_name, login|
Given "there exists an active context called \"#{context_name}\" for user \"#{login}\""
end
Given /^there exists a hidden context called "([^"]*)" for user "([^"]*)"$/ do |context_name, login| Given /^there exists a hidden context called "([^"]*)" for user "([^"]*)"$/ do |context_name, login|
user = User.find_by_login(login) user = User.find_by_login(login)
user.should_not be_nil user.should_not be_nil

View file

@ -11,7 +11,7 @@ if ENV["RAILS_ENV"] == "selenium"
config.selenium_browser_startup_timeout = 30 config.selenium_browser_startup_timeout = 30
# use only if you run a separate selenium server instance and do not # use only if you run a separate selenium server instance and do not
# want webrat to start one for you # want webrat to start one for you
config.selenium_server_address = "localhost" # config.selenium_server_address = "localhost"
# config.selenium_server_port = "4444" # config.selenium_server_port = "4444"
end end