diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index ab3ccc56..9ec49c8d 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -100,6 +100,14 @@ Given /^I have a project "([^\"]*)" with (.*) notes?$/ do |project_name, num| end end +Given /^the default tags for "(.*?)" are "(.*?)"$/ do |project_name, default_tags| + project = @current_user.projects.find_by_name(project_name) + project.should_not be_nil + + project.default_tags = default_tags + project.save! +end + When /^I open the project edit form$/ do click_link "link_edit_project_#{@project.id}" page.should have_css("button#submit_project_#{@project.id}", :visible => true) diff --git a/features/tagging_todos.feature b/features/tagging_todos.feature index d2371db3..d67d1973 100644 --- a/features/tagging_todos.feature +++ b/features/tagging_todos.feature @@ -77,6 +77,14 @@ Feature: Tagging todos When I submit a new action with description "are my tags prefilled" Then the tags of "are my tags prefilled" should be "tests" + @javascript + Scenario: Selecting a project with default tags when editing a todo will prefill the tags field + Given I have a todo "tag me" in the context "@pc" + And the default tags for "hacking tracks" are "TagA, TagB" + When I go to the "@pc" context + And I edit the project of "tag me" to "hacking tracks" + Then the tags of "tag me" should be "taga, tagb" + @javascript Scenario: If there are todos for a tag, when viewing the tag's page, the Tags field for new todos should be defaulted to that tag Given I have a todo "migrate old scripts" in context "@pc" with tags "starred"