refactor sidebar and finish migration of notes

This commit is contained in:
Reinier Balt 2010-11-24 22:01:23 +01:00
parent 94b5aa2346
commit ea1ca130f1
18 changed files with 138 additions and 97 deletions

View file

@ -86,7 +86,6 @@ When /^I try to edit the project name of "([^"]*)" to "([^"]*)"$/ do |project_cu
When "I try to edit the project name to \"#{project_new_name}\""
end
When /^I edit the project name in place to be "([^"]*)"$/ do |new_project_name|
selenium.click "project_name"
fill_in "value", :with => new_project_name
@ -115,6 +114,42 @@ When /^I edit the project state of "([^"]*)" to "([^"]*)"$/ do |project_name, st
end
end
When /^I add a note "([^"]*)" to the project$/ do |note_body|
click_link "Add a note"
fill_in "note[body]", :with => note_body
click_button "Add note"
end
When /^I click on the first note icon$/ do
@project.should_not be_nil
@note = @project.notes.first # assume first note is also first on screen
@note.should_not be_nil
click_link "link_note_#{@note.id}"
end
When /^I cancel adding a note to the project$/ do
click_link "Add a note"
fill_in "note[body]", :with => "will not save this"
click_link "neg_edit_form_note"
end
Then /^the form for adding a note should not be visible$/ do
wait_for do # wait for the form to go away
!selenium.is_visible("edit_form_note")
end
end
Then /^I should go to that note page$/ do
current_path = URI.parse(current_url).path
note_path = note_path(@note)
current_path.should == note_path
end
Then /^I should see one note in the project$/ do
selenium.wait_for_element("xpath=//div[@class='note_wrapper']")
end
Then /^I should see the bold text "([^\"]*)" in the project description$/ do |bold|
xpath="//div[@class='project_description']/p/strong"