mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 10:09:53 +01:00
Add tests for new theme helper functionality
This commit is contained in:
parent
07a13d39da
commit
527f3fc3f5
1 changed files with 18 additions and 0 deletions
|
@ -242,4 +242,22 @@ describe ThemeHelper, :type => :helper do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#get_color_for_key" do
|
||||
context "any key and value are supplied" do
|
||||
subject { helper.get_color_for_key("primary", 6174129) }
|
||||
|
||||
it "returns a hex color code" do
|
||||
expect(subject).to eq("#5e35b1")
|
||||
end
|
||||
end
|
||||
|
||||
context "a text key is supplied" do
|
||||
subject { helper.get_color_for_key("primary-text", 6174129) }
|
||||
|
||||
it "returns RGB triplets" do
|
||||
expect(subject).to eq("94, 53, 177")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue