Dox::Entities::Action - ArgumentError: wrong number of arguments (0 for 1)
Closed this issue · 1 comments
marksiemers commented
Hitting an exception on this line:
@verb = details[:action_verb] || request.method
https://github.com/infinum/dox/blob/master/lib/dox/entities/action.rb#L11
In my app, request
is a Proc
and Proc#method
expects a symbol as an argument: https://ruby-doc.org/core-2.2.0/Object.html#method-i-method
Some context:
# ./spec/requests/groups/show_spec.rb
describe %(get '/api/groups/:id'), type: :request do
include Docs::Groups::Api
let!(:path) { %(/api/groups/#{group.id}) }
let!(:user) { create(:user_with_groups) }
let!(:group) { user.groups.last }
context 'when a user is signed in' do
before { sign_in user }
before { get path }
after { sign_out user }
it 'returns http success (2xx)', :dox do
include Docs::Groups::Show
expect(response).to have_http_status(:success)
end
end
end
# ./spec/docs/groups.rb
module Docs
module Groups
extend Dox::DSL::Syntax
# define common resource data for each action
document :api do
resource 'Groups' do
endpoint '/groups'
group 'Groups'
end
end
# define data for specific action
document :index do
action 'Get groups'
end
document :show do
action 'Get a group'
end
end
end
marksiemers commented
Sorry about this, I had this line, which caused a conflict:
let!(:request) do
-> { rails_respond_without_detailed_exceptions { get path } }
end
I have renamed it, and it is working now. Thanks for this gem!
let!(:request_without_exceptions) do
-> { rails_respond_without_detailed_exceptions { get path } }
end