diff --git a/features/plain/feature_import.feature b/features/plain/feature_import.feature index 8bbdd3a4..8e31d255 100644 --- a/features/plain/feature_import.feature +++ b/features/plain/feature_import.feature @@ -100,10 +100,10 @@ Feature: Users should not have to manually input their features if they have alr When the project is viewed Then I should see a import link When I click import - And select the features feature + And select the "Tag cloud" And the feature is visible And we click import projects - Then a flash message 'We need to a way to store our stories within a project, this will help organise our stories.' should be displayed + Then a flash message 'Feature: Something different, was created' should be displayed Scenario: All scenario's should display the steps associated to it Given there is a project @@ -154,7 +154,7 @@ Feature: Users should not have to manually input their features if they have alr Scenario: A step should be highlighted if it already exists in the system Given there is a project - And the step "When I click new projects" is created + And the step "Then the tags cloud should be displayed" is created And the project does have a project location When the project is viewed Then I should see a import link @@ -174,7 +174,7 @@ Feature: Users should not have to manually input their features if they have alr When I click import Then I should see a list of features that will be imported And we click import projects - Then a flash message 'We need to a way to store our stories within a project, this will help organise our stories.' should be displayed + Then a flash message 'Something different' should be displayed And each imported stories step should be added Scenario: A feature should not be viewable if the feature is already added @@ -185,7 +185,7 @@ Feature: Users should not have to manually input their features if they have alr When I click import Then I should see a list of features that will be imported And we click import projects - Then a flash message 'We need to a way to store our stories within a project, this will help organise our stories.' should be displayed + Then a flash message 'Something different' should be displayed And each imported stories step should be added When the project is viewed Then I should see a import link @@ -194,7 +194,7 @@ Feature: Users should not have to manually input their features if they have alr Scenario: A message should be displayed to the user if there are no features to import Given there is a project - And the project does have a project location + And the project does have a project location with no features to import And there are no features to import When the project is viewed Then I should see a import link @@ -209,7 +209,7 @@ Feature: Users should not have to manually input their features if they have alr When I click import Then I should see a list of features that will be imported And we click import projects - Then a flash message 'We need to a way to store our stories within a project, this will help organise our stories.' should be displayed + Then a flash message 'Something different' should be displayed And we should be redirected to the projects import page Scenario: When importing features, we should be able to find feature regardless of the feature directory structure @@ -277,8 +277,8 @@ Feature: Users should not have to manually input their features if they have alr When the project is viewed Then I should see a import link When I click import - And we click import "enhancements" - Then the features scenario "Basic pages we want to visit to check for JS enabled" should be saved + And we click import "most used" + Then the features scenario "Our actions that we want to check states for" should be saved Scenario: A feature should not be submittable if a duplicate scenario is found in the new feature Given there is a project diff --git a/features/step_definitions/projects_steps.rb b/features/step_definitions/projects_steps.rb index e3dd5822..fed00f87 100644 --- a/features/step_definitions/projects_steps.rb +++ b/features/step_definitions/projects_steps.rb @@ -16,11 +16,11 @@ end Given /^the project does have a project location$/ do - @project.location.should_not be_nil + @project.update_attribute(:location, "#{RAILS_ROOT}/spec/fixtures/") end Given /^a step already exists$/ do - response.should contain "When I click new projects" + response.should contain "Then the tags cloud should be displayed" end Given /^there are no features to import$/ do @@ -48,6 +48,10 @@ Feature.stub!(:imports_found).with("#{RAILS_ROOT}") end +Given /^the project does have a project location with no features to import$/ do + @project.update_attribute(:location,"#{RAILS_ROOT}/spec/fixtures/features") +end + When /^the project already exists$/ do @project.should_receive(:save).and_return false end @@ -95,7 +99,7 @@ When /^I click import$/ do file = "#{RAILS_ROOT}/features/plain/enhancements.feature" - result ||= {:file => File.basename(file), :feature => FeatureFile.new(file).export} + result = {:file => File.basename(file), :feature => FeatureFile.new(file).export} @project.stub!(:import_features).and_return [result] click_link 'Import' end @@ -309,18 +313,18 @@ response.should contain "Scenario: #{Story.find(3).scenario}" end -When /^select the features feature$/ do - click_link 'feature import' +When /^select the "([^\"]*)"$/ do |link| + click_link 'Tag cloud' end When /^the feature is visible$/ do response.should have_selector :div do |content| - content.should have_selector :h3, :content => "Feature: projects" + content.should have_selector :h3, :content => "Feature: tag cloud" end end When /^we click import projects$/ do - click_button 'Import projects' + click_button 'Import tag cloud' end Then /^we scenario should display that is is already added$/ do @@ -343,11 +347,11 @@ end Then /^it should be highlighted$/ do - response.should have_selector :b, :content => "When I click new projects" + response.should have_selector :b, :content => "Then the tags cloud should be displayed" end Then /^each imported stories step should be added$/ do - assert(Step.find_by_title("Given I can view the projects page").title) + assert(Step.find_by_title("Then the tags cloud should be displayed").title) end Then /^the project feature will be not be selectable\.$/ do @@ -387,7 +391,7 @@ end Then /^it should include features from all sub directories within the feature directory$/ do - response.should contain "Feature: hover functionality" + response.should contain "Feature: most used" end Then /^the "([^\"]*)" "([^\"]*)" "([^\"]*)" should have an error class$/ do |model, attribute, input|