Reputation: 6924
I have ActiveAdmin controller for actions with some database objects.
ActiveAdmin.register MyObject do
In that file I got an action, which uses some parameters and creates a file:
collection_action :some_method_name, method: :get do
What is a proper way to create a RSpec spec for that action which will pass some parameters and perform checks in resulting file?
Upvotes: 0
Views: 610
Reputation: 3122
require 'spec_helper'
describe Admin::MyObjectsController do
describe "#some_method_name" do
it "does some stuff" do
params = {a: 1, b: 2}
get :some_method_name, params
expect(response).to be_success
end
end
end
Upvotes: 2