| 1 |
require "spec_helper" |
| 2 |
|
| 3 |
describe "contains" do |
| 4 |
before(:all) do |
| 5 |
ParserSupport.parse_file("validators/contains") |
| 6 |
end |
| 7 |
|
| 8 |
context "called on array with single item" do |
| 9 |
it "contains item" do |
| 10 |
expect(".single").to have_rule("color: #fff") |
| 11 |
end |
| 12 |
|
| 13 |
it "doesn't contain missing item" do |
| 14 |
expect(".single-missing").to have_rule("color: #000") |
| 15 |
end |
| 16 |
end |
| 17 |
|
| 18 |
context "called with array with multiple items" do |
| 19 |
it "contains item" do |
| 20 |
expect(".multiple").to have_rule("color: #fff") |
| 21 |
end |
| 22 |
|
| 23 |
it "doesn't contain missing item" do |
| 24 |
expect(".multiple-missing").to have_rule("color: #000") |
| 25 |
end |
| 26 |
end |
| 27 |
end |