0

I have a Post with checkboxes for Categories like post_categories I was trying a matcher on RSpec like:

expect(page).not_to have_checkbox "Sports"

but this matcher not exist. I'm trying different ways. But I'm having difficult on which way is the properly. In this case what is recommended?

on the form I create a policy for show just the properly users:

- if policy(post).change_category?
  = f.association :categories, label: "Select the Categories:", as: :check_boxes , collection: @categories.map{|c| [c.name, c.id]}, include_hidden: false
rld
  • 2,603
  • 2
  • 25
  • 39

1 Answers1

0

I forget to put the click_link for edit the post.

click_link "Edit Post"

expect(page).not_to have_css('form div.post_categories')
rld
  • 2,603
  • 2
  • 25
  • 39