Sha256: 316fb7918b0d2e01c023a4efac189261190e19740709ac4ee4ed9dda95fc5896

Contents?: true

Size: 317 Bytes

Versions: 51

Compression:

Stored size: 317 Bytes

Contents

require 'rails_helper'

RSpec.describe "User", :type => :model do
  it "prevents duplicates " do
		user1 = create(:user, code: 'abc', email: 'test@email.com')
		user2 = build(:user, code: 'abc', email: 'test@email.com')

		user1.should be_valid
		#user2.should be_valid
		user2.should_not  have_valid(:code)
	end
end

Version data entries

51 entries across 48 versions & 4 rubygems

Version Path
jinda-0.8.0 test/dummy/spec/models/user_spec.rb
jinda-0.8.0 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.7.4 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.7.4 test/dummy/spec/models/user_spec.rb
jinda-0.7.7.3 test/dummy/spec/models/user_spec.rb
jinda-0.7.7.3 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.7.2 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.7.1 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda_mind-1.0.0 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.7 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.6 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.5.5 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.5.4 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.5.3 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.5.2 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.5.0 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.3 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.2 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.1 lib/generators/jinda/templates/spec/models/user_spec.rb
jinda-0.7.0.4 lib/generators/jinda/templates/spec/models/user_spec.rb