Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
emerencia committed Jan 24, 2020
1 parent 0955d84 commit e84b4df
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@

before do
allow(Rails.application.config.settings.feature_toggles).to receive(:allow_distribution_export).and_return(true)
allow(Rails.application.config.settings).to(receive(:distribution_export_min_responses).and_return(0))
allow(RedisService).to receive(:get).and_return({ 'total' => 1 }.to_json)
end

describe 'general' do
Expand All @@ -99,9 +101,8 @@
end

it 'returns the correct value' do
expect(RedisService).to receive(:get).with("distribution_#{questionnaire.key}").and_return('something')
get :distribution, params: { key: questionnaire.key }
expect(response.body).to eq 'something'
expect(response.body).to eq '{"total":1}'
end
end
end
Expand Down

0 comments on commit e84b4df

Please sign in to comment.