mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 08:58:09 +08:00
DEV: Avoid instance variables in specs
Small followup of https://github.com/discourse/discourse/pull/27705
This commit is contained in:

committed by
Loïc Guitaut

parent
797f659eed
commit
b0480dd34e
@ -12,18 +12,16 @@ module OneboxHelpers
|
||||
end
|
||||
|
||||
RSpec.shared_context "with engines" do
|
||||
before do
|
||||
fixture = defined?(@onebox_fixture) ? @onebox_fixture : described_class.onebox_name
|
||||
stub_request(:get, defined?(@uri) ? @uri : @link).to_return(
|
||||
status: 200,
|
||||
body: onebox_response(fixture),
|
||||
)
|
||||
end
|
||||
|
||||
let(:onebox) { described_class.new(link) }
|
||||
let(:html) { onebox.to_html }
|
||||
let(:data) { onebox.send(:data).deep_symbolize_keys }
|
||||
let(:link) { @link }
|
||||
let(:uri) { defined?(@uri) ? @uri : link }
|
||||
|
||||
before do
|
||||
fixture = defined?(@onebox_fixture) ? @onebox_fixture : described_class.onebox_name
|
||||
stub_request(:get, uri).to_return(status: 200, body: onebox_response(fixture))
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.shared_examples_for "an engine" do
|
||||
|
Reference in New Issue
Block a user