Commit b4fe5a76a75577c45be70459ec8f4e7612d0139b
1 parent
fcc1ba5b
Exists in
master
and in
4 other branches
Fix UsersGroup specs
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/models/users_group.rb
| ... | ... | @@ -18,7 +18,7 @@ class UsersGroup < ActiveRecord::Base |
| 18 | 18 | attr_accessible :group_access, :user_id |
| 19 | 19 | |
| 20 | 20 | belongs_to :user |
| 21 | - belongs_to :project | |
| 21 | + belongs_to :group | |
| 22 | 22 | |
| 23 | 23 | scope :guests, -> { where(group_access: GUEST) } |
| 24 | 24 | scope :reporters, -> { where(group_access: REPORTER) } | ... | ... |
spec/models/users_group_spec.rb
| ... | ... | @@ -13,10 +13,10 @@ describe UsersGroup do |
| 13 | 13 | describe "Validation" do |
| 14 | 14 | let!(:users_group) { create(:users_group) } |
| 15 | 15 | |
| 16 | - it { should validate_presence_of(:user) } | |
| 16 | + it { should validate_presence_of(:user_id) } | |
| 17 | 17 | it { should validate_uniqueness_of(:user_id).scoped_to(:group_id).with_message(/already exists/) } |
| 18 | 18 | |
| 19 | - it { should validate_presence_of(:group) } | |
| 19 | + it { should validate_presence_of(:group_id) } | |
| 20 | 20 | it { should ensure_inclusion_of(:group_access).in_array(UsersGroup.group_access_roles.values) } |
| 21 | 21 | end |
| 22 | 22 | ... | ... |