Skip to content

Commit

Permalink
Merge pull request #166 from pearkes/sort_regions
Browse files Browse the repository at this point in the history
PR #165 with tests
  • Loading branch information
petems committed May 20, 2015
2 parents 58b0e10 + 12ed073 commit 50fe615
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/tugboat/middleware/list_regions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Middleware
class ListRegions < Base
def call(env)
ocean = env["ocean"]
regions = ocean.regions.list.regions
regions = ocean.regions.list.regions.sort_by(&:name)

say "Regions:"
regions.each do |region|
Expand Down
10 changes: 5 additions & 5 deletions spec/fixtures/show_regions.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"status": "OK",
"regions": [
{
"id": 1,
"name": "Region 1",
"slug": "reg1"
},
{
"id": 2,
"name": "Region 2",
Expand All @@ -15,6 +10,11 @@
"id": 3,
"name": "Region 3",
"slug": "reg3"
},
{
"id": 1,
"name": "Region 1",
"slug": "reg1"
}
]
}

0 comments on commit 50fe615

Please sign in to comment.