diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-02 02:53:44 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-08 00:57:26 +0300 |
commit | e48391b813d3e5079238aa3f0662e7a46e1b4a54 (patch) | |
tree | bc7abec1eb4b27a16dcf47d09483b967bffdd3a8 /spec/requests | |
parent | b3200c8c44f2351d88d5d78d7ded3ac06001bd7c (diff) |
Add custom ColorValidator
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/labels_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb index aff109a9424..667f0dbea5c 100644 --- a/spec/requests/api/labels_spec.rb +++ b/spec/requests/api/labels_spec.rb @@ -47,7 +47,7 @@ describe API::API, api: true do name: 'Foo', color: '#FFAA' expect(response.status).to eq(400) - expect(json_response['message']['color']).to eq(['is invalid']) + expect(json_response['message']['color']).to eq(['must be a valid color code']) end it 'should return 400 for too long color code' do @@ -55,7 +55,7 @@ describe API::API, api: true do name: 'Foo', color: '#FFAAFFFF' expect(response.status).to eq(400) - expect(json_response['message']['color']).to eq(['is invalid']) + expect(json_response['message']['color']).to eq(['must be a valid color code']) end it 'should return 400 for invalid name' do @@ -151,12 +151,12 @@ describe API::API, api: true do expect(json_response['message']['title']).to eq(['is invalid']) end - it 'should return 400 for invalid name' do + it 'should return 400 when color code is too short' do put api("/projects/#{project.id}/labels", user), name: 'label1', color: '#FF' expect(response.status).to eq(400) - expect(json_response['message']['color']).to eq(['is invalid']) + expect(json_response['message']['color']).to eq(['must be a valid color code']) end it 'should return 400 for too long color code' do @@ -164,7 +164,7 @@ describe API::API, api: true do name: 'Foo', color: '#FFAAFFFF' expect(response.status).to eq(400) - expect(json_response['message']['color']).to eq(['is invalid']) + expect(json_response['message']['color']).to eq(['must be a valid color code']) end end end |