Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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

This comment has been minimized.

Copy link
Owner Author

@chrislerum chrislerum commented Jun 23, 2016

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