add tests for toggling visibility of collapsed contexts

This commit is contained in:
Reinier Balt 2011-09-10 00:51:39 +02:00
parent 30c2fb8b82
commit cdff38995c
5 changed files with 127 additions and 5 deletions

View file

@ -16,10 +16,6 @@ Given /^I have a project "([^\"]*)" with (.*) notes?$/ do |project_name, num|
end
end
When /^I click Toggle Notes$/ do
click_link 'Toggle notes'
end
When /^I add note "([^\"]*)" from the "([^\"]*)" project page$/ do |note, project|
project = Project.find_by_name(project)
project.notes.create!(:user_id => @current_user.id, :body => note)
@ -44,6 +40,23 @@ When /^I edit the first note to "([^"]*)"$/ do |note_body|
click_button "submit_note_#{id}"
end
When /^I toggle the note of "([^"]*)"$/ do |todo_description|
todo = @current_user.todos.find_by_description(todo_description)
todo.should_not be_nil
xpath = "//div[@id='line_todo_#{todo.id}']/div/a/img"
selenium.click(xpath)
end
When /^I click Toggle Notes$/ do
click_link 'Toggle notes'
end
When /^I toggle all notes$/ do
When "I click Toggle Notes"
end
Then /^(.*) notes should be visible$/ do |number|
# count number of project_notes
count = 0