Prepare spec_helper for focused tests

This commit is contained in:
Daniel Schädler 2018-11-29 11:02:25 +01:00
parent 8e7869b879
commit a75087aa6c
2 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,7 @@ RSpec.describe MatchesController, type: :controller do
it 'should return the correct state' do it 'should return the correct state' do
get :show, params: { id: @match.to_param } get :show, params: { id: @match.to_param }
body = ActiveModelSerializers::Deserialization.jsonapi_parse(JSON.parse(response.body)) body = ActiveModelSerializers::Deserialization.jsonapi_parse(JSON.parse(response.body))
expect(body[:state]).to be(@match.state) expect(body[:state]).to eq(@match.state)
expect(body[:score_ids]).to eq(@match.scores.map { |score| score.id.to_s }) expect(body[:score_ids]).to eq(@match.scores.map { |score| score.id.to_s })
end end
end end

View File

@ -22,6 +22,10 @@ RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate # rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest # assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer. # assertions if you prefer.
# only runs tests with " , focus: true "
# config.filter_run focus: true
config.expect_with :rspec do |expectations| config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description` # This option will default to `true` in RSpec 4. It makes the `description`
# and `failure_message` of custom matchers include text for helper methods # and `failure_message` of custom matchers include text for helper methods