From a0d38c8fb8da8bef74a7d1377bef892d7b6204b0 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Wed, 16 Mar 2016 11:42:51 +0800 Subject: [PATCH] check https manual icons --- spec/models/metacode_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/models/metacode_spec.rb b/spec/models/metacode_spec.rb index fc31e3e1..ad0b6ced 100644 --- a/spec/models/metacode_spec.rb +++ b/spec/models/metacode_spec.rb @@ -15,9 +15,16 @@ RSpec.describe Metacode, type: :model do end context 'NEITHER aws_icon or manual_icon' do - let(:metacode2) { build(:metacode, aws_icon: nil, manual_icon: nil) } + let(:metacode) { build(:metacode, aws_icon: nil, manual_icon: nil) } it 'raises a validation error' do - expect { metacode2.save! }.to raise_error ActiveRecord::RecordInvalid + expect { metacode.save! }.to raise_error ActiveRecord::RecordInvalid + end + end + + context 'non-https manual icon' do + let(:metacode) { build(:metacode, manual_icon: 'http://metamaps.cc/assets/user.png') } + it 'raises a validation error' do + expect { metacode.save! }.to raise_error ActiveRecord::RecordInvalid end end end