From a009c37d6fd8192de479518cd728ed5c9eb44a50 Mon Sep 17 00:00:00 2001 From: Ilya Zhitomirskiy Date: Fri, 23 Sep 2011 18:58:19 -0700 Subject: [PATCH] fixed the cukes and the tag following --- features/accepts_invitation.feature | 4 ++-- features/signs_up.feature | 2 +- features/step_definitions/custom_web_steps.rb | 7 +++++++ spec/controllers/tag_followings_controller_spec.rb | 6 ++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/features/accepts_invitation.feature b/features/accepts_invitation.feature index 6b1033a29..95bfaa07c 100644 --- a/features/accepts_invitation.feature +++ b/features/accepts_invitation.feature @@ -11,7 +11,7 @@ Feature: invitation acceptance And I press "Create my account" Then I should be on the getting started page And I should see "Welcome" - Then I follow "Edit Profile" + Then I follow Edit Profile in the same window And I fill in the following: | profile_first_name | O | | profile_last_name | Hai | @@ -35,7 +35,7 @@ Feature: invitation acceptance And I press "Create my account" Then I should be on the getting started page And I should see "Welcome" - Then I follow "Edit Profile" + Then I follow Edit Profile in the same window And I fill in the following: | profile_first_name | O | | profile_last_name | Hai | diff --git a/features/signs_up.feature b/features/signs_up.feature index 564fe2fdc..d4fd95052 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -17,7 +17,7 @@ Feature: new user registration And I should see "Connect to Cubbi.es" Scenario: new user goes through the setup wizard - When I follow "Edit Profile" + When I follow Edit Profile in the same window And I fill in "profile_first_name" with "O" And I fill in "profile_last_name" with "Hai" And I fill in "tags" with "#tags" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index cbe75db81..84c60bc3d 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -195,3 +195,10 @@ When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name| find(:xpath, "//a[@rel='facebox'][.//img[@title='Edit #{aspect_name}']]").click end end + +Then /^I follow Edit Profile in the same window$/ do + page.execute_script("$('a[href=\"#{edit_profile_path}\"]').removeAttr('target')") + + And %(I follow "Edit Profile") +end + diff --git a/spec/controllers/tag_followings_controller_spec.rb b/spec/controllers/tag_followings_controller_spec.rb index ff79bf7de..833b2980c 100644 --- a/spec/controllers/tag_followings_controller_spec.rb +++ b/spec/controllers/tag_followings_controller_spec.rb @@ -56,18 +56,16 @@ describe TagFollowingsController do }.to_not change(alice.tag_followings, :count).by(1) end - it "redirects and flashes success to the tag page" do + it "flashes success to the tag page" do post :create, valid_attributes - response.should redirect_to(tag_path(:name => valid_attributes[:name])) flash[:notice].should == "Successfully following: ##{valid_attributes[:name]}" end - it "redirects and flashes error if you already have a tag" do + it "flashes error if you already have a tag" do TagFollowing.any_instance.stub(:save).and_return(false) post :create, valid_attributes - response.should redirect_to(tag_path(:name => valid_attributes[:name])) flash[:error].should == "Failed to follow: ##{valid_attributes[:name]}" end