Skip to content

Commit

Permalink
test: add coverage for all the colour filters
Browse files Browse the repository at this point in the history
These filters follow separate routes in code so should be covered independently
  • Loading branch information
knarewski committed Oct 30, 2024
1 parent 7055301 commit 622a9ad
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 34 additions & 6 deletions spec/morandi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,42 @@
end

describe 'when given an fx option' do
let(:options) { { 'fx' => 'sepia' } }
let(:options) { { 'fx' => filter_name } }

it 'applies filter to the image' do
process_image
context 'with sepia' do
let(:filter_name) { 'sepia' }

expect(File).to exist(file_out)
expect(processed_image_type).to eq('jpeg')
expect(file_out).to match_reference_image('plasma-sepia')
it 'applies filter to the image' do
process_image

expect(File).to exist(file_out)
expect(processed_image_type).to eq('jpeg')
expect(file_out).to match_reference_image('plasma-sepia')
end
end

context 'with bluetone' do
let(:filter_name) { 'bluetone' }

it 'applies filter to the image' do
process_image

expect(File).to exist(file_out)
expect(processed_image_type).to eq('jpeg')
expect(file_out).to match_reference_image('plasma-bluetone')
end
end

context 'with greyscale' do
let(:filter_name) { 'greyscale' }

it 'applies filter to the image' do
process_image

expect(File).to exist(file_out)
expect(processed_image_type).to eq('jpeg')
expect(file_out).to match_reference_image('plasma-greyscale')
end
end
end

Expand Down

0 comments on commit 622a9ad

Please sign in to comment.