diff --git a/web/spec/requests/musician_search_api_spec.rb b/web/spec/requests/musician_search_api_spec.rb index a48a1c6b1..99c87588b 100644 --- a/web/spec/requests/musician_search_api_spec.rb +++ b/web/spec/requests/musician_search_api_spec.rb @@ -59,7 +59,7 @@ describe "Musician Search API", :type => :api do it "gets no musicians for unused instruments" do get_query({:instrument => 'tuba'}) good_response - expect(json.count).to be 0 + expect(json.count).to eq(0) end end diff --git a/web/spec/requests/search_api_spec.rb b/web/spec/requests/search_api_spec.rb index 84d95af52..a3475939f 100644 --- a/web/spec/requests/search_api_spec.rb +++ b/web/spec/requests/search_api_spec.rb @@ -16,7 +16,7 @@ describe "Search API", :type => :api do it "empty search" do get '/api/search.json' last_response.status.should == 200 - JSON.parse(last_response.body).should eql(JSON.parse('{}')) + JSON.parse(last_response.body).should eql({'search_type'=>nil}) end it "simple search" do @@ -25,25 +25,15 @@ describe "Search API", :type => :api do @band = Band.save(nil, "Peach pit", "www.bands.com", "zomg we rock", "Apex", "NC", "US", ["hip hop"], user.id, nil, nil) @band2 = Band.save(nil, "Peach", "www.bands2.com", "zomg we rock", "Apex", "NC", "US", ["hip hop"], user.id, nil, nil) - get '/api/search.json?query=peach' + get '/api/search.json?query=peach&search_text_type=bands' last_response.status.should == 200 response = JSON.parse(last_response.body) - response["musicians"].length.should == 1 - musician = response["musicians"][0] - musician["id"].should == @musician.id - - response["fans"].length.should == 1 - fan = response["fans"][0] - fan["id"].should == @fan.id - response["bands"].length.should == 2 bands = response["bands"] bands = [bands[0]["id"], bands[1]["id"]] bands.should include(@band.id) bands.should include(@band2.id) - - response["recordings"].should == nil end end end