From 0c4a70a306b871899bf87ce4673918abfee4d95f Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 12 Feb 2015 19:17:35 +0100 Subject: Updated rspec to rspec 3.x syntax Signed-off-by: Jeroen van Baarsen --- spec/models/label_spec.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'spec/models/label_spec.rb') diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb index 31634648f04..8644ac46605 100644 --- a/spec/models/label_spec.rb +++ b/spec/models/label_spec.rb @@ -14,30 +14,30 @@ require 'spec_helper' describe Label do let(:label) { create(:label) } - it { label.should be_valid } + it { expect(label).to be_valid } - it { should belong_to(:project) } + it { is_expected.to belong_to(:project) } describe 'Validation' do it 'should validate color code' do - build(:label, color: 'G-ITLAB').should_not be_valid - build(:label, color: 'AABBCC').should_not be_valid - build(:label, color: '#AABBCCEE').should_not be_valid - build(:label, color: '#GGHHII').should_not be_valid - build(:label, color: '#').should_not be_valid - build(:label, color: '').should_not be_valid + expect(build(:label, color: 'G-ITLAB')).not_to be_valid + expect(build(:label, color: 'AABBCC')).not_to be_valid + expect(build(:label, color: '#AABBCCEE')).not_to be_valid + expect(build(:label, color: '#GGHHII')).not_to be_valid + expect(build(:label, color: '#')).not_to be_valid + expect(build(:label, color: '')).not_to be_valid - build(:label, color: '#AABBCC').should be_valid + expect(build(:label, color: '#AABBCC')).to be_valid end it 'should validate title' do - build(:label, title: 'G,ITLAB').should_not be_valid - build(:label, title: 'G?ITLAB').should_not be_valid - build(:label, title: 'G&ITLAB').should_not be_valid - build(:label, title: '').should_not be_valid + expect(build(:label, title: 'G,ITLAB')).not_to be_valid + expect(build(:label, title: 'G?ITLAB')).not_to be_valid + expect(build(:label, title: 'G&ITLAB')).not_to be_valid + expect(build(:label, title: '')).not_to be_valid - build(:label, title: 'GITLAB').should be_valid - build(:label, title: 'gitlab').should be_valid + expect(build(:label, title: 'GITLAB')).to be_valid + expect(build(:label, title: 'gitlab')).to be_valid end end end -- cgit v1.2.1