Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Add basic test coverage for grid-media
Browse files Browse the repository at this point in the history
  • Loading branch information
whmii committed Aug 20, 2016
1 parent 451de46 commit 516c797
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
39 changes: 39 additions & 0 deletions spec/fixtures/mixins/grid-media.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@import "setup";

$medium-screen: 1000px;

$custom-neat-grid: (
columns: 12,
gutter: 50px,
media: $medium-screen,
);

$specific-neat-grid: (
columns: 12,
gutter: 80px,
media: "only screen and (min-width: 1000px) and (max-width: 1100px)",
);

$print-neat-grid: (
columns: 10,
gutter: 20px,
media: print,
);

.grid-column-media-custom-neat-grid {
@include grid-media($custom-neat-grid) {
@include grid-column(3);
}
}

.grid-column-media-specific-neat-grid {
@include grid-media($specific-neat-grid) {
@include grid-column(6);
}
}

.grid-column-media-print-neat-grid {
@include grid-media($print-neat-grid) {
@include grid-column(8);
}
}
25 changes: 25 additions & 0 deletions spec/neat/mixins/grid_media_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require "spec_helper"

describe "@include grid-media() {...}" do
before(:all) do
ParserSupport.parse_file("mixins/grid-media")
end

context "with argument ($custom-neat-grid)" do
it "outputs @media only screen and (min-width: 1000px)" do
expect(".grid-column-media-custom-neat-grid").to be_contained_in("only screen and (min-width: 1000px)")
end
end

context "with argument ($specific-neat-grid)" do
it "outputs @media only screen and (min-width: 1000px) and (max-width: 1100px)" do
expect(".grid-column-media-specific-neat-grid").to be_contained_in("only screen and (min-width: 1000px) and (max-width: 1100px)")
end
end

context "with argument ($print-neat-grid)" do
it "outputs @media print" do
expect(".grid-column-media-print-neat-grid").to be_contained_in("print")
end
end
end

0 comments on commit 516c797

Please sign in to comment.