mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 06:33:55 +08:00
493d437e79
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
29 lines
768 B
Ruby
29 lines
768 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe Onebox::Engine::HTML do
|
|
before do
|
|
@link = "http://amazon.com"
|
|
|
|
stub_request(:get, @link).to_return(status: 200, body: onebox_response("amazon"))
|
|
stub_request(:get, "https://www.amazon.com/Seven-Languages-Weeks-Programming-Programmers/dp/193435659X")
|
|
.to_return(status: 200, body: onebox_response("amazon"))
|
|
end
|
|
|
|
describe "#raw" do
|
|
class OneboxEngineHTML
|
|
include Onebox::Engine
|
|
include Onebox::Engine::HTML
|
|
|
|
def initialize(link)
|
|
@url = link
|
|
@options = {}
|
|
end
|
|
end
|
|
|
|
it "returns a Nokogiri object that has a css method" do
|
|
object = OneboxEngineHTML.new("http://amazon.com").send(:raw)
|
|
expect(object).to respond_to(:css)
|
|
end
|
|
end
|
|
end
|