Simplify Settings API

This commit is contained in:
Josep Jaume Rey Peroy
2015-12-10 11:26:42 +01:00
parent 89ece16fe8
commit 5de3d700e4
16 changed files with 64 additions and 46 deletions

View File

@@ -24,7 +24,7 @@ describe DebatesController do
describe "Vote with too many anonymous votes" do
it 'should allow vote if user is allowed' do
Setting.find_by(key: "max_ratio_anon_votes_on_debates").update(value: 100)
Setting["max_ratio_anon_votes_on_debates"] = 100
debate = create(:debate)
sign_in create(:user)
@@ -34,7 +34,7 @@ describe DebatesController do
end
it 'should not allow vote if user is not allowed' do
Setting.find_by(key: "max_ratio_anon_votes_on_debates").update(value: 0)
Setting["max_ratio_anon_votes_on_debates"] = 0
debate = create(:debate, cached_votes_total: 1000)
sign_in create(:user)