Skip to content

Commit

Permalink
Merge pull request #4307 from rubyforgood/fix-user-spec
Browse files Browse the repository at this point in the history
Fix user spec
  • Loading branch information
cielf authored Apr 26, 2024
2 parents ebd6e3e + 3eb390c commit 343dc25
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions spec/requests/users_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@
end

it "should set last_role to partner" do
@user.add_role(Role::PARTNER, partner)
user.add_role(Role::PARTNER, partner)

partner_role = @user.roles.find { |r| r.name == Role::PARTNER.to_s }
partner_role = user.roles.find { |r| r.name == Role::PARTNER.to_s }

expect do
get switch_to_role_users_path(@organization,
role_id: partner_role.id)
end.to change(@user, :last_role).from(nil).to(partner_role)
get switch_to_role_users_path(organization, role_id: partner_role.id)
end.to change(user, :last_role).from(nil).to(partner_role)
end
end

Expand Down

0 comments on commit 343dc25

Please sign in to comment.