-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change location/locality to postcode and add fields to store parish/w…
…ard etc.
- Loading branch information
Showing
13 changed files
with
150 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddLocationToInitiatives < ActiveRecord::Migration[6.0] | ||
def change | ||
remove_column :initiatives, :locality, :string | ||
remove_column :initiatives, :location, :string | ||
|
||
add_column :initiatives, :postcode, :string | ||
add_column :initiatives, :parish, :string | ||
add_column :initiatives, :ward, :string | ||
add_column :initiatives, :district, :string | ||
add_column :initiatives, :county, :string | ||
add_column :initiatives, :region, :string | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
bundle exec rails test | ||
bundle exec rails test:system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,45 +9,51 @@ class InitiativesTest < ApplicationSystemTestCase | |
assert_selector 'h1', text: 'Initiatives' | ||
end | ||
|
||
test 'creating a Initiative' do | ||
visit initiatives_url | ||
sign_in_as :georgie | ||
click_on 'New Initiative' | ||
|
||
fill_in 'Name', with: 'Initiative name', match: :first | ||
fill_in 'Summary', with: 'Summary' | ||
fill_in 'Anticipated carbon saving', with: '200' | ||
fill_in 'Contact email', with: '[email protected]', match: :first | ||
fill_in 'Contact name', with: 'contact name', match: :first | ||
fill_in 'Contact phone', with: 'contact phone', match: :first | ||
select 'Down to Earth Stroud', from: 'Lead group' | ||
fill_in 'Locality', with: 'Postcode' | ||
fill_in 'Location', with: 'Parish' | ||
fill_in 'Partner groups role', with: 'Partner role' | ||
select 'Operational', from: 'Status' | ||
click_on 'Create Initiative' | ||
|
||
assert_text 'Initiative was successfully created' | ||
if js? | ||
test 'creating a Initiative' do | ||
visit initiatives_url | ||
sign_in_as :georgie | ||
click_on 'New Initiative' | ||
|
||
fill_in 'Name', with: 'Initiative name', match: :first | ||
fill_in 'Summary', with: 'Summary' | ||
fill_in 'Anticipated carbon saving', with: '200' | ||
fill_in 'Contact email', with: '[email protected]', match: :first | ||
fill_in 'Contact name', with: 'contact name', match: :first | ||
fill_in 'Contact phone', with: 'contact phone', match: :first | ||
select 'Down to Earth Stroud', from: 'Lead group' | ||
fill_in 'Postcode', with: 'Postcode' | ||
fill_in 'Partner groups role', with: 'Partner role' | ||
select 'Operational', from: 'Status' | ||
click_on 'Energy' | ||
click_by_title 'Add Heating' | ||
click_on 'Create Initiative' | ||
|
||
assert_text 'Initiative was successfully created' | ||
end | ||
|
||
test 'updating a Initiative' do | ||
visit initiatives_url | ||
sign_in_as :georgie | ||
click_on 'Edit', match: :first | ||
|
||
fill_in 'Name', with: 'Initiative name', match: :first | ||
fill_in 'Summary', with: 'Summary' | ||
fill_in 'Anticipated carbon saving', with: '200' | ||
fill_in 'Contact email', with: '[email protected]', match: :first | ||
fill_in 'Contact name', with: 'contact name', match: :first | ||
fill_in 'Contact phone', with: 'contact phone', match: :first | ||
select 'Down to Earth Stroud', from: 'Lead group' | ||
fill_in 'Postcode', with: 'Postcode' | ||
fill_in 'Partner groups role', with: 'Partner role' | ||
select 'Operational', from: 'Status' | ||
click_on 'Update Initiative' | ||
|
||
assert_text 'Initiative was successfully updated' | ||
end | ||
end | ||
|
||
test 'updating a Initiative' do | ||
visit initiatives_url | ||
sign_in_as :georgie | ||
click_on 'Edit', match: :first | ||
|
||
fill_in 'Name', with: 'Initiative name', match: :first | ||
fill_in 'Summary', with: 'Summary' | ||
fill_in 'Anticipated carbon saving', with: '200' | ||
fill_in 'Contact email', with: '[email protected]', match: :first | ||
fill_in 'Contact name', with: 'contact name', match: :first | ||
fill_in 'Contact phone', with: 'contact phone', match: :first | ||
select 'Down to Earth Stroud', from: 'Lead group' | ||
fill_in 'Locality', with: 'Postcode' | ||
fill_in 'Location', with: 'Parish' | ||
fill_in 'Partner groups role', with: 'Partner role' | ||
select 'Operational', from: 'Status' | ||
click_on 'Update Initiative' | ||
|
||
assert_text 'Initiative was successfully updated' | ||
def click_by_title(title) | ||
find("a[title='#{title}']").click | ||
end | ||
end |