mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-06 21:00:20 +01:00
Fix regressions and refactorings
This commit is contained in:
parent
41ebd2ec9b
commit
ca7d81d75a
21 changed files with 259 additions and 397 deletions
|
|
@ -1,21 +1,3 @@
|
|||
Given /^I have one project "([^\"]*)" with no notes$/ do |project_name|
|
||||
@current_user.projects.create!(:name => project_name)
|
||||
end
|
||||
|
||||
Given /^I have two projects with one note each$/ do
|
||||
project_a = @current_user.projects.create!(:name => 'project A')
|
||||
project_a.notes.create!(:user_id => @current_user.id, :body => 'note for project A')
|
||||
project_b = @current_user.projects.create!(:name => 'project B')
|
||||
project_b.notes.create!(:user_id => @current_user.id, :body => 'note for project B')
|
||||
end
|
||||
|
||||
Given /^I have a project "([^\"]*)" with (.*) notes?$/ do |project_name, num|
|
||||
project = @current_user.projects.create!(:name => project_name)
|
||||
1.upto num.to_i do |i|
|
||||
project.notes.create!(:user_id => @current_user.id, :body => "A note #{i}. This is the very long body of note #{i} where you should not see the last part of the note after 50 characters")
|
||||
end
|
||||
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)
|
||||
|
|
@ -29,6 +11,8 @@ When /^I delete the first note$/ do
|
|||
click_link "delete_note_#{id}"
|
||||
end
|
||||
get_confirm_text.should == "Are you sure that you want to delete the note '#{id}'?"
|
||||
|
||||
page.should_not have_css("a#delete_note_#{id}")
|
||||
end
|
||||
|
||||
When /^I click the icon next to the note$/ do
|
||||
|
|
@ -49,7 +33,6 @@ When /^I toggle the note of "([^"]*)"$/ do |todo_description|
|
|||
todo.should_not be_nil
|
||||
|
||||
xpath = "//div[@id='line_todo_#{todo.id}']/div/a/img"
|
||||
|
||||
page.find(:xpath, xpath).click
|
||||
end
|
||||
|
||||
|
|
@ -84,9 +67,7 @@ Then /^the first note should disappear$/ do
|
|||
id = title.split(' ').last
|
||||
note = "div#note_#{id}"
|
||||
|
||||
wait_until do
|
||||
!page.has_selector?(note)
|
||||
end
|
||||
page.should_not have_css(note, :visible=>true)
|
||||
end
|
||||
|
||||
Then /^I should see the note text$/ do
|
||||
|
|
@ -95,11 +76,10 @@ end
|
|||
|
||||
Then /^I should not see the note "([^"]*)"$/ do |note_content|
|
||||
if page.has_selector?("div", :text => note_content)
|
||||
page.find("div", :text => note_content).visible?.should be_false
|
||||
page.find("div", :text => note_content).should_not be_visible
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should see the note "([^"]*)"$/ do |note_content|
|
||||
page.find("div", :text => note_content).visible?.should be_true
|
||||
end
|
||||
|
||||
page.find("div", :text => note_content).should be_visible
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue