Sha256: db24e98fcf61e2280a28eff2d40ab549fbfeaf583d25f1dd5415157403005dd5

Contents?: true

Size: 476 Bytes

Versions: 15

Compression:

Stored size: 476 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

15 entries across 15 versions & 1 rubygems

Version Path
introspective_grape-0.3.2 spec/models/team_user_spec.rb
introspective_grape-0.3.1 spec/models/team_user_spec.rb
introspective_grape-0.3.0 spec/models/team_user_spec.rb
introspective_grape-0.2.9 spec/models/team_user_spec.rb
introspective_grape-0.2.8 spec/models/team_user_spec.rb
introspective_grape-0.2.7 spec/models/team_user_spec.rb
introspective_grape-0.2.6 spec/models/team_user_spec.rb
introspective_grape-0.2.5 spec/models/team_user_spec.rb
introspective_grape-0.2.4 spec/models/team_user_spec.rb
introspective_grape-0.2.3 spec/models/team_user_spec.rb
introspective_grape-0.2.2 spec/models/team_user_spec.rb
introspective_grape-0.2.0 spec/models/team_user_spec.rb
introspective_grape-0.1.9 spec/models/team_user_spec.rb
introspective_grape-0.0.4 spec/models/team_user_spec.rb
introspective_grape-0.0.3 spec/models/team_user_spec.rb