Sha256: 49e74bf981eb674da585c6640be00e26587693f097dcda8ba5460ea99cf8ae26

Contents?: true

Size: 618 Bytes

Versions: 29

Compression:

Stored size: 618 Bytes

Contents

require 'spec_helper'

describe User do

  describe "user_key" do
    before do
      @user = User.new.tap {|u| u.email = "foo@example.com"}
      @user.stub(:username =>'foo')
    end

    it "should return email" do
      @user.user_key.should == 'foo@example.com'
    end

    it "should return username" do
      Devise.stub(:authentication_keys =>[:username])
      @user.user_key.should == '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

29 entries across 29 versions & 1 rubygems

Version Path
hydra-core-7.2.1 spec/models/user_spec.rb
hydra-core-7.2.0 spec/models/user_spec.rb
hydra-core-7.1.0 spec/models/user_spec.rb
hydra-core-7.1.0.rc2 spec/models/user_spec.rb
hydra-core-7.1.0.rc1 spec/models/user_spec.rb
hydra-core-6.5.2 spec/models/user_spec.rb
hydra-core-6.5.1 spec/models/user_spec.rb
hydra-core-7.0.2 spec/models/user_spec.rb
hydra-core-6.4.2 spec/models/user_spec.rb
hydra-core-7.0.1 spec/models/user_spec.rb
hydra-core-7.0.0 spec/models/user_spec.rb
hydra-core-7.0.0.rc1 spec/models/user_spec.rb
hydra-core-7.0.0.pre3 spec/models/user_spec.rb
hydra-core-6.5.0 spec/models/user_spec.rb
hydra-core-6.5.0.rc2 spec/models/user_spec.rb
hydra-core-7.0.0.pre2 spec/models/user_spec.rb
hydra-core-7.0.0.pre1 spec/models/user_spec.rb
hydra-core-6.4.1 spec/models/user_spec.rb
hydra-core-6.4.0 spec/models/user_spec.rb
hydra-core-6.4.0.rc5 spec/models/user_spec.rb