From 52d5a20673f7984dc9465e4b8576e7a59ff8d498 Mon Sep 17 00:00:00 2001 From: hisayohorie Date: Wed, 21 Jun 2017 15:58:21 -0400 Subject: [PATCH 1/5] added a text to check council's name is displayed on the contribution page --- spec/features/user_contributes_new_councillor_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/features/user_contributes_new_councillor_spec.rb b/spec/features/user_contributes_new_councillor_spec.rb index 75bd10c38..9dc887a09 100644 --- a/spec/features/user_contributes_new_councillor_spec.rb +++ b/spec/features/user_contributes_new_councillor_spec.rb @@ -3,6 +3,11 @@ feature "Contributing a new councillor for an authority" do let(:authority) { create(:authority, full_name: "Casey City Council") } + scenario "on the contribution page" do + visit new_authority_suggested_councillor_path(authority.short_name_encoded) + expect(page).to have_content("Casey City Council") + end + context "when the feature flag is off" do it "isn't available" do visit new_authority_suggested_councillor_path(authority.short_name_encoded) From d4b84ae0ab530cc6bb33cb8ce30e6171497451ca Mon Sep 17 00:00:00 2001 From: hisayohorie Date: Wed, 21 Jun 2017 17:21:14 -0400 Subject: [PATCH 2/5] Adding the Council Name in the view suggested_councillor#new --- app/views/suggested_councillors/new.html.haml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/suggested_councillors/new.html.haml b/app/views/suggested_councillors/new.html.haml index fd0cd6f74..fcc27c9f0 100644 --- a/app/views/suggested_councillors/new.html.haml +++ b/app/views/suggested_councillors/new.html.haml @@ -1,3 +1,6 @@ +%p + Council Name: #{@authority.full_name} + = form_for [@authority, @suggested_councillor], url: authority_suggested_councillors_path do |f| %fieldset %legend From 119d9e923ff5015366812a1ba0720ef8cc144f30 Mon Sep 17 00:00:00 2001 From: hisayohorie Date: Wed, 21 Jun 2017 22:53:02 -0400 Subject: [PATCH 3/5] Correctly nest a test in feature_flag is on The test for Council Name is nested in the feature_flag_is_on test, so that the feature is visible in the test environment. --- spec/features/user_contributes_new_councillor_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/features/user_contributes_new_councillor_spec.rb b/spec/features/user_contributes_new_councillor_spec.rb index 9dc887a09..2d7cc451c 100644 --- a/spec/features/user_contributes_new_councillor_spec.rb +++ b/spec/features/user_contributes_new_councillor_spec.rb @@ -3,11 +3,6 @@ feature "Contributing a new councillor for an authority" do let(:authority) { create(:authority, full_name: "Casey City Council") } - scenario "on the contribution page" do - visit new_authority_suggested_councillor_path(authority.short_name_encoded) - expect(page).to have_content("Casey City Council") - end - context "when the feature flag is off" do it "isn't available" do visit new_authority_suggested_councillor_path(authority.short_name_encoded) @@ -22,6 +17,11 @@ test.run end end + + scenario "on the contribution page" do + visit new_authority_suggested_councillor_path(authority.short_name_encoded) + expect(page).to have_content("Casey City Council") + end it "successfully" do visit new_authority_suggested_councillor_path(authority.short_name_encoded) From fd92a83fe90bf530514013f6e93331f9175d25a3 Mon Sep 17 00:00:00 2001 From: hisayohorie Date: Thu, 22 Jun 2017 00:09:38 -0400 Subject: [PATCH 4/5] Added a header in suggested councillor contribution page to make it more readable and clear. still need some styling. --- app/views/suggested_councillors/new.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/suggested_councillors/new.html.haml b/app/views/suggested_councillors/new.html.haml index fcc27c9f0..9b318c303 100644 --- a/app/views/suggested_councillors/new.html.haml +++ b/app/views/suggested_councillors/new.html.haml @@ -1,5 +1,4 @@ -%p - Council Name: #{@authority.full_name} +%h1 Add a new councillor for #{@authority.full_name} = form_for [@authority, @suggested_councillor], url: authority_suggested_councillors_path do |f| %fieldset From 56cfaec578c6a1a0df61326877f2247228e327a3 Mon Sep 17 00:00:00 2001 From: hisayohorie Date: Thu, 22 Jun 2017 00:19:18 -0400 Subject: [PATCH 5/5] Added an extra line for styling To separate the test exercise and test expectation. --- spec/features/user_contributes_new_councillor_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/features/user_contributes_new_councillor_spec.rb b/spec/features/user_contributes_new_councillor_spec.rb index 2d7cc451c..514fe7634 100644 --- a/spec/features/user_contributes_new_councillor_spec.rb +++ b/spec/features/user_contributes_new_councillor_spec.rb @@ -20,6 +20,7 @@ scenario "on the contribution page" do visit new_authority_suggested_councillor_path(authority.short_name_encoded) + expect(page).to have_content("Casey City Council") end