14 lines
356 B
Ruby
14 lines
356 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
RSpec.shared_context "AjaxController context" do
|
||
|
shared_examples "returns the expected response" do
|
||
|
it "returns the expected response" do
|
||
|
expect(JSON.parse(subject.body)).to match(expected_response)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
RSpec.configure do |c|
|
||
|
c.include_context "AjaxController context", ajax_controller: true
|
||
|
end
|