adds spec for Setting

This commit is contained in:
Juanjo Bazán
2015-08-31 11:52:33 +02:00
committed by Juanjo Bazán
parent de71f55103
commit 916f0bf901
2 changed files with 30 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
describe Setting do
it "should be accesible by key" do
create(:setting, key: "Important Setting", value: "42")
expect(Setting.value_for("Important Setting")).to eq("42")
end
it "should be nil if key does not exist" do
expect(Setting.value_for("Undefined key")).to be_nil
end
end