Skip to content
Browse files

Merge pull request #40 from alphagov/clean-contact-feature

remove old contacts.feature
  • Loading branch information...
2 parents 55b8080 + 4866b88 commit 50177ca5f45775f45f73eb92626d070d57799708 @fatbusinessman fatbusinessman committed Nov 21, 2012
View
22 features/contacts.feature
@@ -1,22 +0,0 @@
-Feature: Managing contacts
- In order that citizens know who to talk to if GovUK doesn't answer their question
- I want to connect contacts and artefacts
- This feature is not currently in use
-
- Background:
- Given I am an admin
-
-# Scenario: Assign a contact
-# Given an artefact exists
-# And a contact exists
-# When I add the contact to the artefact
-# Then I should be redirected to Publisher
-# And the API should say that the artefact has the contact
-
-# Scenario: Unassign a contact
-# Given an artefact exists
-# And a contact exists
-# And the artefact has the contact
-# When I remove the contact from the artefact
-# Then I should be redirected to Publisher
-# And the API should say that the artefact does not have the contact
View
8 features/step_definitions/api_steps.rb
@@ -15,14 +15,6 @@
check_artefact_does_not_have_related_artefact_in_api @artefact, @unrelated_artefact
end
-Then /^the API should say that the artefact has the contact$/ do
- check_artefact_has_contact_in_api @artefact, @contact
-end
-
-Then /^the API should say that the artefact does not have the contact$/ do
- check_artefact_does_not_have_contact_in_api @artefact, @contact
-end
-
Then /^the API should say that the artefact has the section$/ do
check_artefact_has_tag_in_api @artefact, @section.tag_id
end
View
16 features/step_definitions/artefact_steps.rb
@@ -106,16 +106,6 @@
@sections = create_sections
end
-When /^I add the contact to the artefact$/ do
- visit edit_artefact_path(@artefact)
- select_contact @contact
- submit_artefact_form
-end
-
-Given /^the artefact has the contact$/ do
- add_contact @artefact, @contact
-end
-
Given /^the artefact has the section$/ do
add_section @artefact, @section
end
@@ -126,12 +116,6 @@
end
end
-When /^I remove the contact from the artefact$/ do
- visit edit_artefact_path(@artefact)
- unselect_contact @contact
- submit_artefact_form
-end
-
When /^I add the section to the artefact$/ do
visit edit_artefact_path(@artefact)
select_section @section
View
3 features/step_definitions/contact_steps.rb
@@ -1,3 +0,0 @@
-Given /^a contact exists$/ do
- @contact = create_contact
-end
View
12 features/support/api.rb
@@ -11,10 +11,6 @@ def tag_ids_from_api(artefact)
artefact_data_from_api(artefact)[:tag_ids]
end
-def contact_id_from_api(artefact)
- artefact_data_from_api(artefact)[:contact].try(:[], :id)
-end
-
def check_artefact_exists_in_api(artefact_or_slug)
if artefact_or_slug.is_a?(Hash)
slug = artefact_or_slug[:slug]
@@ -42,14 +38,6 @@ def check_artefact_does_not_have_related_artefact_in_api(artefact, unrelated_art
refute_includes related_artefact_ids_from_api(artefact), unrelated_artefact.id.to_s
end
-def check_artefact_has_contact_in_api(artefact, contact)
- assert_equal contact_id_from_api(artefact), contact.id.to_s
-end
-
-def check_artefact_does_not_have_contact_in_api(artefact, contact)
- assert_not_equal contact_id_from_api(artefact), contact.id.to_s
-end
-
def check_artefact_has_tag_in_api(artefact, tag_id)
assert_includes tag_ids_from_api(artefact), tag_id
end
View
15 features/support/contacts.rb
@@ -1,15 +0,0 @@
-def create_contact
- FactoryGirl.create :contact, :name => 'Child Support Agency'
-end
-
-def select_contact(contact)
- select contact.name, :from => 'Contact'
-end
-
-def unselect_contact(contact)
- select '', :from => 'Contact'
-end
-
-def add_contact(artefact, contact)
- artefact.update_attributes! :contact => contact
-end

0 comments on commit 50177ca

Please sign in to comment.
Something went wrong with that request. Please try again.