File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1111
1212 context "without client" do
1313 subject { Query . new }
14+
1415 it "should not work" do
1516 expect { subject } . to raise_error ( ArgumentError )
1617 end
3435 let ( :query ) { Query . new ( @client ) }
3536
3637 context "with valid pattern" do
37- before { allow_any_instance_of ( Query ) . to receive ( : pattern) . and_return ( "christmas" ) }
38+ before { query . pattern = "christmas" }
3839 subject { query . url }
40+
3941 it { should include ( "xmloutputversion=2" ) }
4042 end
4143
4648 end
4749
4850 context "with empty pattern" do
49- before { allow_any_instance_of ( Query ) . to receive ( :pattern ) . and_return ( "" ) }
51+ before { query . pattern = "" }
52+
5053 it "raises an error" do
5154 expect { query . url } . to raise_error ( RuntimeError , "Missing pattern" )
5255 end
5356 end
5457 end
5558
5659 context "with valid pattern" do
57- before { allow_any_instance_of ( Query ) . to receive ( :pattern ) . and_return ( "christmas" ) }
60+ before { subject . pattern = "christmas" }
61+
5862 it "should add language" do
5963 subject . language = "en"
6064 expect ( subject . request_parameters ) . to include ( documentlang : 'en' )
7781 end
7882
7983 describe "#pattern" do
84+ before { subject . pattern = "spotify" }
85+
8086 it "should add searchpattern" do
81- subject . pattern = 'spotify'
8287 expect ( subject . url_parameters ) . to include ( "searchpattern=spotify" )
8388 end
8489 end
You can’t perform that action at this time.
0 commit comments