This commit is contained in:
r888888888
2017-06-29 16:05:01 -07:00
parent c4503e9971
commit d7690d24b0
6 changed files with 15 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
require 'test_helper'
require 'helpers/saved_search_test_helper'
require 'fakeweb'
class SavedSearchTest < ActiveSupport::TestCase
include SavedSearchTestHelper
@@ -46,14 +45,10 @@ class SavedSearchTest < ActiveSupport::TestCase
end
context "Fetching the post ids for a search" do
teardown do
FakeWeb.clean_registry
end
context "with a label" do
setup do
SavedSearch.expects(:queries_for).with(1, "blah").returns(%w(a b c))
FakeWeb.register_uri(:post, "http://localhost:3001/v2/search", :body => "1 2 3 4")
stub_request(:post, "http://localhost:3001/v2/search").to_return(:body => "1 2 3 4")
end
should "return a list of ids" do
@@ -65,7 +60,7 @@ class SavedSearchTest < ActiveSupport::TestCase
context "without a label" do
setup do
SavedSearch.expects(:queries_for).with(1, nil).returns(%w(a b c))
FakeWeb.register_uri(:post, "http://localhost:3001/v2/search", :body => "1 2 3 4")
stub_request(:post, "http://localhost:3001/v2/search").to_return(:body => "1 2 3 4")
end
should "return a list of ids" do