fixed the cukes and the tag following

This commit is contained in:
Ilya Zhitomirskiy 2011-09-23 18:58:19 -07:00
parent 720721633c
commit a009c37d6f
4 changed files with 12 additions and 7 deletions

View file

@ -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 |

View file

@ -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"

View file

@ -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

View file

@ -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