generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default zone from Southwark to Central London
We need the zone to be a top level zone because the map starts zoomed out.
- Loading branch information
1 parent
dc83fa8
commit d6c2074
Showing
7 changed files
with
17 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
class Zone < ApplicationRecord | ||
DEFAULT_ZONE_SOUTHWARK_CERC_ID = 29 | ||
DEFAULT_ZONE_CENTRAL_LONDON_CERC_ID = 55 | ||
|
||
def self.default | ||
find_by!(cerc_id: DEFAULT_ZONE_SOUTHWARK_CERC_ID) | ||
find_by!(cerc_id: DEFAULT_ZONE_CENTRAL_LONDON_CERC_ID) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
def create_default_zone | ||
FactoryBot.create(:zone, name: "Southwark", cerc_id: 29) | ||
FactoryBot.create(:zone, name: "Central London", cerc_id: 55) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
RSpec.describe Zone do | ||
describe "::default" do | ||
before { FactoryBot.create(:zone, cerc_id: Zone::DEFAULT_ZONE_SOUTHWARK_CERC_ID) } | ||
before { FactoryBot.create(:zone, cerc_id: Zone::DEFAULT_ZONE_CENTRAL_LONDON_CERC_ID) } | ||
|
||
it "returns Southwark's Zone record" do | ||
expect(Zone.default.cerc_id).to eq(Zone::DEFAULT_ZONE_SOUTHWARK_CERC_ID) | ||
it "returns Central London zone record" do | ||
expect(Zone.default.cerc_id).to eq(Zone::DEFAULT_ZONE_CENTRAL_LONDON_CERC_ID) | ||
end | ||
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