Skip to content

Commit

Permalink
fix typo in README series orderby startYear, not startDate (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurasimmons30 authored and O-I committed Jun 27, 2016
1 parent a42af4d commit df25836
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Descriptions and examples of the supported actions are below. Note, all methods
```ruby
@client.series
@client.series(title: 'Uncanny X-Men')
@client.series(titleStartsWith: 'Astonishing', orderBy: 'startDate', limit: 100)
@client.series(titleStartsWith: 'Astonishing', orderBy: 'startYear', limit: 100)
```

- Fetches a single comic series by id. [`GET /v1/public/series/{seriesId}`](http://developer.marvel.com/docs#!/public/getSeriesIndividual_get_26)
Expand Down
10 changes: 10 additions & 0 deletions spec/marvel_api/client/client_series_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
'15-Love GN-TPB (2013 - Present)']
end

it 'can order list by startYear' do
sorted_list = client.series.sort_by {|entry| entry["startYear"]}

sorted_start_years = sorted_list.map {|entry| entry["startYear"]}
unsorted_start_years = client.series.map {|entry| entry["startYear"]}

expect(sorted_start_years == unsorted_start_years).to eq(false)
expect(sorted_start_years == unsorted_start_years.sort).to eq(true)
end

it 'requests public/v1/series successfully' do
expect(client.series.status).to eq 'Ok'
end
Expand Down

0 comments on commit df25836

Please sign in to comment.