Skip to content

Instantly share code, notes, and snippets.

@mikebaldry
Created September 16, 2013 14:40
Show Gist options
  • Save mikebaldry/6581588 to your computer and use it in GitHub Desktop.
Save mikebaldry/6581588 to your computer and use it in GitHub Desktop.
Rails asset_host failure
Failure/Error: expect(helper.image_url("blah.jpg")).to eq("http://this-is-a-test.com/assets/blah.jpg")
expected: "http://this-is-a-test.com/assets/blah.jpg"
got: "http://test.hosthttp://this-is-a-test.com/assets/blah.jpg"
(compared using ==)
describe "bug with image_url" do
before do
ActionController::Base.asset_host = 'this-is-a-test.com'
end
after do
ActionController::Base.asset_host = nil
end
it "should return the correct urls" do
expect(helper.image_url("blah.jpg")).to eq("http://this-is-a-test.com/assets/blah.jpg")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment