finish the feature description for notes. Some scenarios need js handling to implement. They are marked with the tag needsjs

exclude them with cucumber -t ~needsjs
This commit is contained in:
Reinier Balt 2009-05-25 21:20:50 +02:00
parent 149d05e04f
commit 8002eef8ab
2 changed files with 17 additions and 42 deletions

View file

@ -12,14 +12,6 @@ Then /^(.*) notes should be visible$/ do |number|
count.should == number.to_i
end
Then "the badge should show (.*)" do |number|
badge = -1
response.should have_xpath("//span[@id='badge_count']") do |node|
badge = node.first.content.to_i
end
badge.should == number.to_i
end
When /^I click Toggle Notes$/ do
click_link 'Toggle notes'
end
@ -44,11 +36,15 @@ Then /^I should see note "([^\"]*)" on the notes page$/ do |note|
Then "I should see \"#{note}\""
end
Given /^I have a project "([^\"]*)" with 2 notes$/ do |arg1|
pending
Given /^I have a project "([^\"]*)" with (.*) notes?$/ do |project_name, num|
project = @current_user.projects.create!(:name => project_name)
num.to_i.downto 0 do |i|
project.notes.create!(:user_id => @current_user.id, :body => "A note #{i}")
end
end
When /^I delete the first note$/ do
# need selenium for this to check on the js
pending
end
@ -56,37 +52,22 @@ Given /^I have one project "([^\"]*)" with 1 note$/ do |arg1|
pending
end
When /^I visit the "([^\"]*)" project page$/ do |arg1|
pending
end
When /^I click the icon next to the note$/ do
# need selenium for this to check on the js
pending
end
Then /^I should see the note text$/ do
# need selenium for this to check on the js
pending
end
#------
Given "Luis has one project Pass Final Exam with no notes" do
@exam_project = @luis.projects.create!(:name => 'Pass Final Exam')
Then /^I should see the body of the notes$/ do
pending
end
Given "Luis has one project Pass Final Exam with 1 note" do
Given "Luis has one project Pass Final Exam with no notes"
@exam_project.notes.create!(:user_id => @luis.id, :body => 'exam note 1')
end
Given "Luis has one project Pass Final Exam with 2 notes" do
Given "Luis has one project Pass Final Exam with 1 note"
@exam_project.notes.create!(:user_id => @luis.id, :body => 'exam note 2')
end
When "Luis visits the notes page" do
visits '/notes'
end
#------ left over from old stories. can be removed if pending stuff is done
When "Luis adds a note from the Pass Final Exam project page" do
When "Luis visits the Pass Final Exam project page"
@ -95,10 +76,6 @@ fills_in 'new_note_body', :with => 'new exam note'
clicks_button 'Add note', :wait => :ajax
end
When "Luis visits the Pass Final Exam project page" do
visits "/projects/#{@exam_project.to_param}"
end
When "Luis deletes the first note" do
selenium.click "css=a.delete_note"
selenium.get_confirmation.should =~ /delete/
@ -113,10 +90,6 @@ When "Luis clicks Toggle Notes" do
clicks_link 'Toggle notes', :wait => :effects
end
Then "the body of the notes should be shown" do
pending
end
Then "Luis should see the note on the Pass Final Exam project page" do
should_see "new exam note"
end