{"action":"created","issue":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1659","repository_url":"https://api.github.com/repos/rails-api/active_model_serializers","labels_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1659/labels{/name}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1659/comments","events_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1659/events","html_url":"https://github.com/rails-api/active_model_serializers/issues/1659","id":145677904,"number":1659,"title":"Undefined method '*' in specs (wildcard) with RSpec","user":{"login":"kofronpi","id":5551692,"avatar_url":"https://avatars.githubusercontent.com/u/5551692?v=3","gravatar_id":"","url":"https://api.github.com/users/kofronpi","html_url":"https://github.com/kofronpi","followers_url":"https://api.github.com/users/kofronpi/followers","following_url":"https://api.github.com/users/kofronpi/following{/other_user}","gists_url":"https://api.github.com/users/kofronpi/gists{/gist_id}","starred_url":"https://api.github.com/users/kofronpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kofronpi/subscriptions","organizations_url":"https://api.github.com/users/kofronpi/orgs","repos_url":"https://api.github.com/users/kofronpi/repos","events_url":"https://api.github.com/users/kofronpi/events{/privacy}","received_events_url":"https://api.github.com/users/kofronpi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/S:%20Needs%20Bug%20Verification","name":"S: Needs Bug Verification","color":"eb6420"},{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/V:%200.10.x","name":"V: 0.10.x","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-04T13:02:22Z","updated_at":"2016-04-04T16:51:45Z","closed_at":null,"body":"#### Expected behavior vs actual behavior\r\n\r\nWhen I run specs to test my controller, specs fails because '*' is not a method of the parent model class.\r\n\r\n#### Steps to reproduce\r\n\r\n1. Install rails 5.0.0beta3\r\n2. Install active_model_serializers 0.10.0rc4\r\n3. Install rspec 3.5.0beta3\r\n4. Create a dummy `Company` class which `belongs_to` a `CompanyStructure` class\r\n5. Configure AMS to use `:jsonapi`\r\n6. Use this serializer:\r\n```\r\nclass CompanySerializer < ActiveModel::Serializer\r\n  attributes :id\r\n  belongs_to :company_structure\r\nend\r\n```\r\n7. Use this controller:\r\n```\r\nmodule Api\r\n  module V1\r\n    class CompaniesController < ApiController\r\n      def index\r\n        render json: Company.all, include: '*'\r\n      end\r\n    end\r\n  end\r\nend\r\n```\r\n8. Use this rails initializer:\r\n`ActiveModelSerializers.config.adapter = :json_api`\r\n9. Use these specs:\r\n```\r\nrequire 'rails_helper'\r\nrequire \"#{Rails.root}/app/controllers/api/v1/companies_controller.rb\"\r\nRSpec.describe Api::V1::CompaniesController, type: :controller do\r\n  describe '#index' do\r\n    it_behaves_like 'an index request'\r\n  end\r\nend\r\n```\r\nand\r\n\r\n```\r\nshared_examples_for 'a successful request' do\r\n  it 'returns an OK (200) status code' do\r\n    expect(response.status).to eq(200)\r\n  end\r\nend\r\n\r\nshared_examples_for 'an index request' do\r\n  before do\r\n    FactoryGirl.create_list(described_class.controller_name.singularize.to_sym, 2)\r\n    get 'index'\r\n  end\r\n\r\n  it_behaves_like 'a successful request'\r\nend\r\n```\r\n\r\nSpecs fail.\r\n\r\n#### Environment\r\n\r\nActiveModelSerializers Version *0.10.0.rc4*\r\n\r\nOutput of `ruby -e \"puts RUBY_DESCRIPTION\"`: `ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]`\r\n \r\nOS Type & Version: Ubuntu 14.04\r\n\r\nIntegrated application and version *Rails 5.0.0beta3*: \r\n\r\n#### Backtrace\r\n```\r\nFailures:\r\n\r\n  1) Api::V1::CompaniesController#index behaves like an index request behaves like a successful request returns an OK (200) status code\r\n     Failure/Error: render json: Company.all, include: '*'\r\n     \r\n     NoMethodError:\r\n       undefined method `*' for #<Company:0x00000007b68af8>\r\n     Shared Example Group: \"a successful request\" called from ./spec/support/shared_api_examples.rb:13\r\n     Shared Example Group: \"an index request\" called from ./spec/controllers/api/v1/companies_controller_spec.rb:5\r\n     # ./app/controllers/api/v1/companies_controller.rb:5:in `index'\r\n     # ./spec/support/shared_api_examples.rb:10:in `block (2 levels) in <top (required)>'\r\n```\r\n\r\nThank you !\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/comments/205389792","html_url":"https://github.com/rails-api/active_model_serializers/issues/1659#issuecomment-205389792","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1659","id":205389792,"user":{"login":"kofronpi","id":5551692,"avatar_url":"https://avatars.githubusercontent.com/u/5551692?v=3","gravatar_id":"","url":"https://api.github.com/users/kofronpi","html_url":"https://github.com/kofronpi","followers_url":"https://api.github.com/users/kofronpi/followers","following_url":"https://api.github.com/users/kofronpi/following{/other_user}","gists_url":"https://api.github.com/users/kofronpi/gists{/gist_id}","starred_url":"https://api.github.com/users/kofronpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kofronpi/subscriptions","organizations_url":"https://api.github.com/users/kofronpi/orgs","repos_url":"https://api.github.com/users/kofronpi/repos","events_url":"https://api.github.com/users/kofronpi/events{/privacy}","received_events_url":"https://api.github.com/users/kofronpi/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T16:51:45Z","updated_at":"2016-04-04T16:51:45Z","body":"I use this single statement in a rails initializer: `ActiveModelSerializers.config.adapter = :json_api`\r\nI might have a look later on about a more accurate stack trace."}}