fix #742. The tests were already there for some time

This commit is contained in:
Reinier Balt 2011-09-28 23:28:36 +02:00
parent 2f0bfbbf47
commit 033b4daf9a
2 changed files with 10 additions and 9 deletions

View file

@ -21,7 +21,7 @@ Feature: Manage the list of contexts
And I should see "@boss"
And the badge should show 3
Scenario: Clicking on a project takes me to the context page
Scenario: Clicking on a context takes me to the context page
Given I have a context called "@computer"
When I go to the contexts page
And I follow "@computer"
@ -114,3 +114,4 @@ Feature: Manage the list of contexts
Then the new context form should not be visible
When I follow "Create a new context"
Then the new context form should be visible

View file

@ -42,14 +42,6 @@ When /^I add a new hidden context "([^"]*)"$/ do |context_name|
submit_new_context_form
end
Then /^context "([^"]*)" should be above context "([^"]*)"$/ do |context_high, context_low|
high_id = @current_user.contexts.find_by_name(context_high).id
low_id = @current_user.contexts.find_by_name(context_low).id
high_pos = selenium.get_element_position_top("//div[@id='context_#{high_id}']").to_i
low_pos = selenium.get_element_position_top("//div[@id='context_#{low_id}']").to_i
(high_pos < low_pos).should be_true
end
When /^I drag context "([^"]*)" below context "([^"]*)"$/ do |context_drag, context_drop|
drag_id = @current_user.contexts.find_by_name(context_drag).id
drop_id = @current_user.contexts.find_by_name(context_drop).id
@ -67,6 +59,14 @@ When /^I drag context "([^"]*)" below context "([^"]*)"$/ do |context_drag, cont
selenium.mouse_up_at(drop_context_container_xpath,coord_string)
end
Then /^context "([^"]*)" should be above context "([^"]*)"$/ do |context_high, context_low|
high_id = @current_user.contexts.find_by_name(context_high).id
low_id = @current_user.contexts.find_by_name(context_low).id
high_pos = selenium.get_element_position_top("//div[@id='context_#{high_id}']").to_i
low_pos = selenium.get_element_position_top("//div[@id='context_#{low_id}']").to_i
(high_pos < low_pos).should be_true
end
Then /^I should see that a context named "([^"]*)" is not present$/ do |context_name|
Then "I should not see \"#{context_name}\""
end