spec/subroute_spec.rb in lookout-rack-utils-2.0.0 vs spec/subroute_spec.rb in lookout-rack-utils-3.0.0
- old
+ new
@@ -1,6 +1,7 @@
require 'spec_helper'
+require 'json'
describe Lookout::Rack::Utils::Subroute, :type => :route do
describe '#subroute' do
let(:route) { '/test_route' }
let(:original) { get route }
@@ -82,11 +83,11 @@
subject(:subrouted) { get "/test_delete" }
its(:status) { should be 201 }
it 'should return expected output' do
- expect(JSON.parse(subrouted.body)['deleted']).to be_true
+ expect(JSON.parse(subrouted.body)['deleted']).to be true
end
end
context 'to an invalid verb' do
subject(:subrouted) { subroute!('/test_delete_invalid', :request_path => 'DELATE') }
@@ -118,37 +119,37 @@
describe '#succeeded?' do
subject { SubrouteTestHelper.new.succeeded?(status) }
context 'with status 200' do
let(:status) { 200 }
- it { should be_true }
+ it { should be true }
end
context 'with status 299' do
let(:status) { 299 }
- it { should be_true }
+ it { should be true }
end
context 'with a non-20x status' do
let(:status) { 300 }
- it { should be_false }
+ it { should be false }
end
end
describe '#failed?' do
subject { SubrouteTestHelper.new.failed?(status) }
context 'with status 200' do
let(:status) { 200 }
- it { should be_false }
+ it { should be false }
end
context 'with status 299' do
let(:status) { 299 }
- it { should be_false }
+ it { should be false }
end
context 'with a non-20x status' do
let(:status) { 300 }
- it { should be_true }
+ it { should be true }
end
end
end