diff --git a/features/manage_project.feature b/features/manage_project.feature index 88893ed5..f460bd5e 100644 --- a/features/manage_project.feature +++ b/features/manage_project.feature @@ -26,3 +26,11 @@ Feature: Manage a project And I change the project_name field of "Todo 1" to "bar" Then I should not see the todo "Todo 1" And I should see the todo "Todo 2" + + # Ticket #1041 + @selenium + Scenario: I can change the name of the project using the Edit Project Settings form + Given I have a project "bananas" with 1 todos + When I visit the "bananas" project + And I edit the project name to "cherries" + Then the project title should be "cherries" diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 801104c9..bb200f1a 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -27,6 +27,12 @@ When /^I edit the project description to "([^\"]*)"$/ do |new_description| click_button "submit_project_#{@project.id}" end +When /^I edit the project name to "([^\"]*)"$/ do |new_title| + click_link "link_edit_project_#{@project.id}" + fill_in "project[name]", :with => new_title + click_button "submit_project_#{@project.id}" +end + Then /^I should see the bold text "([^\"]*)" in the project description$/ do |bold| xpath="//div[@class='project_description']/p/strong" @@ -44,3 +50,7 @@ Then /^I should see the italic text "([^\"]*)" in the project description$/ do | italic_text.should =~ /#{italic}/ end + +Then /^the project title should be "(.*)"$/ do |title| + selenium.get_text("css=h2#project_name").should == title +end