spec/grape/validations/regexp_spec.rb in grape-0.7.0 vs spec/grape/validations/regexp_spec.rb in grape-0.8.0
- old
+ new
@@ -18,16 +18,23 @@
def app
ValidationsSpec::RegexpValidatorSpec::API
end
- it 'refuses invalid input' do
- get '/', name: "invalid name"
- last_response.status.should == 400
+ context 'invalid input' do
+ it 'refuses inapppopriate' do
+ get '/', name: "invalid name"
+ expect(last_response.status).to eq(400)
+ end
+
+ it 'refuses nil' do
+ get '/', name: nil
+ expect(last_response.status).to eq(400)
+ end
end
it 'accepts valid input' do
get '/', name: "bob"
- last_response.status.should == 200
+ expect(last_response.status).to eq(200)
end
end