| 1 |
require "spec_helper" |
| 2 |
|
| 3 |
describe "size" do |
| 4 |
before(:all) do |
| 5 |
ParserSupport.parse_file("library/size") |
| 6 |
end |
| 7 |
|
| 8 |
context "called with one size" do |
| 9 |
it "applies same width to both height and width" do |
| 10 |
rule = "height: 10px; width: 10px;" |
| 11 |
|
| 12 |
expect(".size-implicit").to have_ruleset(rule) |
| 13 |
end |
| 14 |
end |
| 15 |
|
| 16 |
context "called with two sizes" do |
| 17 |
it "applies to height and width" do |
| 18 |
rule = "height: 2em; width: 1em;" |
| 19 |
|
| 20 |
expect(".size-both").to have_ruleset(rule) |
| 21 |
end |
| 22 |
end |
| 23 |
|
| 24 |
context "called with auto" do |
| 25 |
it "applies to auto to height" do |
| 26 |
rule = "height: auto; width: 100px;" |
| 27 |
|
| 28 |
expect(".size-auto").to have_ruleset(rule) |
| 29 |
end |
| 30 |
end |
| 31 |
end |