From 063c4a069c1de3ee70cc500906121367b94a7886 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 19 Mar 2013 14:58:58 +0200 Subject: [PATCH] fix wall feature. removed duplicated test --- features/steps/project/project_wall.rb | 18 +++++++++++ features/steps/shared/note.rb | 21 ------------- features/steps/shared/paths.rb | 2 +- spec/features/notes_on_wall_spec.rb | 41 -------------------------- 4 files changed, 19 insertions(+), 63 deletions(-) delete mode 100644 spec/features/notes_on_wall_spec.rb diff --git a/features/steps/project/project_wall.rb b/features/steps/project/project_wall.rb index ba9d3533..a3556929 100644 --- a/features/steps/project/project_wall.rb +++ b/features/steps/project/project_wall.rb @@ -3,4 +3,22 @@ class ProjectWall < Spinach::FeatureSteps include SharedProject include SharedNote include SharedPaths + + + Given 'I write new comment "my special test message"' do + within(".wall-note-form") do + fill_in "note[note]", with: "my special test message" + click_button "Add Comment" + end + end + + Then 'I should see project wall note "my special test message"' do + page.should have_content "my special test message" + end + + Then 'I should see comment "XML attached"' do + within(".note") do + page.should have_content("XML attached") + end + end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 5dcc75f9..299cebe5 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -96,25 +96,4 @@ module SharedNote page.should have_css(".js-note-preview-button", visible: true) end end - - - - # Wall - - Given 'I write new comment "my special test message"' do - within(".js-main-target-form") do - fill_in "note[note]", with: "my special test message" - click_button "Add Comment" - end - end - - Then 'I should see project wall note "my special test message"' do - page.should have_content "my special test message" - end - - Then 'I should see comment "XML attached"' do - within(".note") do - page.should have_content("XML attached") - end - end end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 21f0d786..1af8b478 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -256,7 +256,7 @@ module SharedPaths end Then 'I visit project "Shop" wall page' do - visit wall_project_path(project) + visit project_wall_path(project) end Given 'I visit project wiki page' do diff --git a/spec/features/notes_on_wall_spec.rb b/spec/features/notes_on_wall_spec.rb deleted file mode 100644 index 85151341..00000000 --- a/spec/features/notes_on_wall_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'spec_helper' - -describe "On the project wall", js: true do - let!(:project) { create(:project) } - - before do - login_as :user - project.team << [@user, :master] - visit project_wall_path(project) - end - - subject { page } - - describe "the note form" do - it { should have_css(".wall-note-form", visible: true, count: 1) } - it { find(".wall-note-form input[type=submit]").value.should == "Add Comment" } - it { within(".wall-note-form") { should have_unchecked_field("Notify team via email") } } - - describe "with text" do - before do - within(".wall-note-form") do - fill_in "note[note]", with: "This is awesome" - end - end - - it { within(".wall-note-form") { should_not have_css(".js-comment-button[disabled]") } } - end - end - - describe "when posting a note" do - before do - within(".wall-note-form") do - fill_in "note[note]", with: "This is awsome!" - click_button "Add Comment" - end - end - - it { should have_content("This is awsome!") } - it { within(".wall-note-form") { should have_no_field("note[note]", with: "This is awesome!") } } - end -end