Sha256: 1c0cac8b16d6ddc5b45b87c38e2fdb3236566e85da4c5d5e66816338c94bc19e
Contents?: true
Size: 674 Bytes
Versions: 45
Compression:
Stored size: 674 Bytes
Contents
require 'spec_helper' describe User do describe "user_key" do let(:user) { User.new.tap {|u| u.email = "foo@example.com"} } before do allow(user).to receive(:username).and_return('foo') end it "should return email" do expect(user.user_key).to eq 'foo@example.com' end it "should return username" do allow(Devise).to receive(:authentication_keys).and_return([:username]) expect(user.user_key).to eq 'foo' end end end module UserTestAttributes ['first_name','last_name','full_name','affiliation','photo'].each do |attr| class_eval <<-EOM def #{attr} "test_#{attr}" end EOM end end
Version data entries
45 entries across 45 versions & 1 rubygems