Skip to content

Instantly share code, notes, and snippets.

@chrislerum
Created June 23, 2016 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislerum/0d7b2cd288d58e2b20e09919600e92a2 to your computer and use it in GitHub Desktop.
Save chrislerum/0d7b2cd288d58e2b20e09919600e92a2 to your computer and use it in GitHub Desktop.
<tr>
<td class="my-label">
<input type="checkbox" name="user[role_ids][]" id="role_1" value="1" checked="checked" />
</td>
<td class="value">
<label for="role_1">Approver</label>
</td>
</tr>
scenario "can un-assign roles for user" do
r = Role.where(name: 'Approver').first
u = create(:user)
u.set_roles :approver
visit edit_admin_user_path u
uncheck 'Approver'
click_button 'Update User'
expect(u.roles).to_not include r
end
@chrislerum
Copy link
Author

behaves as if uncheck 'Approver' doesn't happen.
this all works in the browser, just can't get the spec working.
is this not how I should be unchecking a checkbox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment