Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix devise specs for :devise_scope compatibility #2311

Merged
merged 1 commit into from
May 28, 2015

Conversation

tagliala
Copy link
Contributor

Devise 3.5.1 allows objects to specify their devise scope heartcombo/devise@4837bb0

So if we add allow_any_instance_of(User).to receive(:respond_to?).and_return(true) this will respond true here: https://github.com/plataformatec/devise/blob/4837bb0a4e5a1ea00e732f48ee2acef90606a31e/lib/devise/mapping.rb#L34

and the specs will fail.

Moreover, afaik, respond_to? should answer with true or false and this spec

    it 'does not cause error when email is nil' do
      allow_any_instance_of(User).to receive(:respond_to?).and_return(true)
      allow_any_instance_of(User).to receive(:respond_to?).with(:email).and_return(nil)

is doing something else. I think it was supposed to allow_any_instance_of(User).to receive(:email).and_return(nil)

mshibuya added a commit that referenced this pull request May 28, 2015
Fix devise specs for :devise_scope compatibility
@mshibuya mshibuya merged commit dcb774d into railsadminteam:master May 28, 2015
@mshibuya
Copy link
Member

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants