Retrospring/spec/shared_examples/ajax_controllers.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
399 B
Ruby
Raw Normal View History

2020-04-30 10:15:32 -07:00
# frozen_string_literal: true
RSpec.shared_context "AjaxController context" do
2020-04-30 13:57:00 -07:00
let(:user) { FactoryBot.create(:user) }
2020-04-30 10:15:32 -07:00
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