diff options
Diffstat (limited to 'spec/helpers/colors_helper_spec.rb')
-rw-r--r-- | spec/helpers/colors_helper_spec.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/spec/helpers/colors_helper_spec.rb b/spec/helpers/colors_helper_spec.rb index ca5cafb7ebe..328796ef1ae 100644 --- a/spec/helpers/colors_helper_spec.rb +++ b/spec/helpers/colors_helper_spec.rb @@ -39,51 +39,4 @@ RSpec.describe ColorsHelper do end end end - - describe '#rgb_array_to_hex_color' do - context 'valid RGB array' do - where(:rgb_array, :hex_color) do - [0, 0, 0] | '#000000' - [0, 0, 255] | '#0000ff' - [0, 255, 0] | '#00ff00' - [255, 0, 0] | '#ff0000' - [12, 34, 56] | '#0c2238' - [222, 111, 88] | '#de6f58' - [255, 255, 255] | '#ffffff' - end - - with_them do - it 'returns correct hex color' do - expect(helper.rgb_array_to_hex_color(rgb_array)).to eq(hex_color) - end - end - end - - context 'invalid RGB array' do - where(:rgb_array) do - [ - '', - '#000000', - 0, - nil, - [], - [0], - [0, 0], - [0, 0, 0, 0], - [-1, 0, 0], - [0, -1, 0], - [0, 0, -1], - [256, 0, 0], - [0, 256, 0], - [0, 0, 256] - ] - end - - with_them do - it 'raise ArgumentError' do - expect { helper.rgb_array_to_hex_color(rgb_array) }.to raise_error(ArgumentError) - end - end - end - end end |