How do you test if a div tag has a certain css style? I\'m trying to test if it has display:none;
or display:block
.
I tried the following
My way to ensure that element have a certain class:
let(:action_items) { page.find('div.action_items') }
it "action items displayed as buttons" do
action_items.all(:css, 'a').each do |ai|
expect(ai[:class]).to match(/btn/)
end
end
or smthing like this
expect(ai[:style]).to match(/color: red/)
I found it here: http://rubydoc.info/github/jnicklas/capybara/Capybara/Node/Element#%5B%5D-instance_method