mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-08 16:44:20 +01:00
refactor sidebar and finish migration of notes
This commit is contained in:
parent
94b5aa2346
commit
ea1ca130f1
18 changed files with 138 additions and 97 deletions
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ When /^I edit the dependency of "([^"]*)" to '([^'']*)'$/ do |todo_name, deps|
|
|||
fill_in "predecessor_list_todo_#{todo.id}", :with => deps
|
||||
# submit form
|
||||
selenium.click("//div[@id='edit_todo_#{todo.id}']//button[@id='submit_todo_#{todo.id}']", :wait_for => :ajax, :javascript_framework => :jquery)
|
||||
|
||||
end
|
||||
|
||||
Then /^there should not be an error$/ do
|
||||
|
|
@ -126,7 +125,6 @@ Then /^there should not be an error$/ do
|
|||
selenium.is_visible("edit_todo_#{@dep_todo.id}").should == false
|
||||
end
|
||||
|
||||
|
||||
Then /^the dependencies of "(.*)" should include "(.*)"$/ do |child_name, parent_name|
|
||||
parent = @current_user.todos.find_by_description(parent_name)
|
||||
parent.should_not be_nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue