discourse/spec/lib/onebox/engine/google_play_app_onebox_spec.rb
David Taylor c9dab6fd08
DEV: Automatically require 'rails_helper' in all specs (#16077)
It's very easy to forget to add `require 'rails_helper'` at the top of every core/plugin spec file, and omissions can cause some very confusing/sporadic errors.

By setting this flag in `.rspec`, we can remove the need for `require 'rails_helper'` entirely.
2022-03-01 17:50:50 +00:00

32 lines
861 B
Ruby

# frozen_string_literal: true
describe Onebox::Engine::GooglePlayAppOnebox do
before do
@link = "https://play.google.com/store/apps/details?id=com.hulu.plus&hl=en"
stub_request(:get, "https://play.google.com/store/apps/details?id=com.hulu.plus&hl=en")
.to_return(status: 200, body: onebox_response("googleplayapp"))
end
include_context "engines"
it_behaves_like "an engine"
describe "#to_html" do
it "has title" do
expect(html).to include("Hulu: Stream TV, Movies & more")
end
it "has image" do
expect(html).to include("4iScc4heC5Cog-i-es2hIYe0RuewYTkGiJfHAaXv0Kb2Q5b2qpbYWxWiooAPuUEhpg")
end
it "has description" do
expect(html).to include("Enjoy all your TV in one place with a new Hulu experience")
end
it "has price" do
expect(html).to include("Free")
end
end
end