Sha256: 4192418a3a78994c7d3da3fbdbcaf8466fb4dd20f8cadba34a30dec56d4e1cc5

Contents?: true

Size: 471 Bytes

Versions: 16

Compression:

Stored size: 471 Bytes

Contents

require 'rails_helper'

RSpec.describe TeamUser, type: :model do

  it "should make a valid instance" do
    TeamUser.make.valid?.should == true
  end

  it "should save a valid instance" do
    TeamUser.make!.should == TeamUser.last
  end

  it "should validate the user belongs to the project" do
    t = TeamUser.make(team: Team.make!, user: User.make!)
    t.valid?.should == false
    t.errors.messages[:user].first.should =~ /is not on the \w+ project/
  end


end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
introspective_grape-0.6.1 spec/models/team_user_spec.rb
introspective_grape-0.5.7 spec/models/team_user_spec.rb
introspective_grape-0.5.6 spec/models/team_user_spec.rb
introspective_grape-0.5.5 spec/models/team_user_spec.rb
introspective_grape-0.5.4 spec/models/team_user_spec.rb
introspective_grape-0.5.2 spec/models/team_user_spec.rb
introspective_grape-0.5.0 spec/models/team_user_spec.rb
introspective_grape-0.4.3 spec/models/team_user_spec.rb
introspective_grape-0.4.2 spec/models/team_user_spec.rb
introspective_grape-0.4.1 spec/models/team_user_spec.rb
introspective_grape-0.4.0 spec/models/team_user_spec.rb
introspective_grape-0.3.9 spec/models/team_user_spec.rb
introspective_grape-0.3.7 spec/models/team_user_spec.rb
introspective_grape-0.3.6 spec/models/team_user_spec.rb
introspective_grape-0.3.5 spec/models/team_user_spec.rb
introspective_grape-0.3.3 spec/models/team_user_spec.rb