Skip to content

Commit

Permalink
Spec updates
Browse files Browse the repository at this point in the history
  • Loading branch information
irees committed Sep 25, 2017
1 parent 3bb740a commit 3f57b3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion spec/controllers/api/v1/feeds_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@
get :feed_version_update_statistics, id: @feed.onestop_id
expect_json({
feed_onestop_id: @feed.onestop_id,
feed_versions_total: 4
feed_versions_total: 4,
fetched_at_frequency: 15, # check it's a int not rational e.g. (7/4)
scheduled_service_overlap_average: 5.0, # float
scheduled_service_duration_average: 18.75 # float
})
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/models/feed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@
pmf = Feed.feed_version_update_statistics(@feed)
expect(pmf[:feed_versions_total]).to eq(4)
expect(pmf[:feed_versions_filtered]).to eq(4)
expect(pmf[:feed_version_transitions].size).to eq(3)
expect(pmf[:feed_version_transitions]).to match_array([["a", "b"], ["b", "c"], ["c", "d"]])
expect(pmf[:fetched_at_frequency]).to eq(15.0)
expect(pmf[:feed_versions_filtered_sha1].size).to eq(4)
expect(pmf[:feed_versions_filtered_sha1]).to match_array(["a", "b", "c", "d"])
expect(pmf[:fetched_at_frequency]).to eq(15)
expect(pmf[:scheduled_service_overlap_average]).to eq(5.0)
expect(pmf[:scheduled_service_duration_average]).to eq(18.75)
end
Expand All @@ -460,7 +460,7 @@
pmf = Feed.feed_version_update_statistics(@feed)
expect(pmf[:feed_versions_total]).to eq(5)
expect(pmf[:feed_versions_filtered]).to eq(4)
expect(pmf[:feed_version_transitions].size).to eq(3)
expect(pmf[:feed_versions_filtered_sha1].size).to eq(4)
end

it 'works with 0 feed versions' do
Expand Down

0 comments on commit 3f57b3a

Please sign in to comment.