spec/sitehub/candidate_routes_spec.rb in sitehub-0.5.0.alpha7 vs spec/sitehub/candidate_routes_spec.rb in sitehub-0.5.0.alpha8
- old
+ new
@@ -146,11 +146,11 @@
context 'endpoints already set' do
context 'different object supplied' do
it 'raises an error' do
subject.candidates(Collection::SplitRouteCollection.new)
expect { subject.candidates(Collection::RouteCollection.new) }
- .to raise_error(CandidateRoutes::InvalidDefinitionException)
+ .to raise_error(CandidateRoutes::InvalidDefinitionError)
end
end
end
end
@@ -299,20 +299,20 @@
context 'split required' do
it 'raise an error' do
subject.candidates(Collection::SplitRouteCollection.new)
expected_message = described_class::PERCENTAGE_NOT_SPECIFIED_MSG
expect { subject.add(label: :label) {} }
- .to raise_exception described_class::InvalidDefinitionException, expected_message
+ .to raise_exception described_class::InvalidDefinitionError, expected_message
end
end
context 'route required' do
it 'raise an error' do
subject.candidates(Collection::RouteCollection.new)
expected_message = described_class::RULE_NOT_SPECIFIED_MSG
expect { subject.add(label: :label) {} }
- .to raise_exception described_class::InvalidDefinitionException, expected_message
+ .to raise_exception described_class::InvalidDefinitionError, expected_message
end
end
end
context 'url' do
@@ -325,12 +325,15 @@
it 'stores a proxy builder' do
rule = proc { true }
subject.add(rule: rule, label: :label, &block)
- expected_endpoints = described_class.new(id: :label, sitehub_cookie_name: :cookie_name,
- rule: rule, mapped_path: subject.mapped_path, &block).tap do |builder|
+ expected_endpoints = described_class.new(id: :label,
+ sitehub_cookie_name: :cookie_name,
+ rule: rule,
+ mapped_path: subject.mapped_path,
+ &block).tap do |builder|
builder.sitehub_cookie_name subject.sitehub_cookie_name
end.build
expect(subject.candidates.values).to eq([expected_endpoints])
end
@@ -340,11 +343,11 @@
rule = proc { true }
expect do
subject.add rule: rule, label: :label do
split percentage: 20, url: :url, label: :label1
end
- end.to raise_exception described_class::InvalidDefinitionException
+ end.to raise_exception described_class::InvalidDefinitionError
end
end
end
end
@@ -462,10 +465,10 @@
end
context 'already set with a different collection' do
it 'raise an error' do
subject.candidates(:collection1)
- expect { subject.candidates(:collection2) }.to raise_exception described_class::InvalidDefinitionException
+ expect { subject.candidates(:collection2) }.to raise_exception described_class::InvalidDefinitionError
end
end
end
describe '#forward_proxy' do