From 24eb454f1180876de9718fc55c62f39b44bc126b Mon Sep 17 00:00:00 2001 From: Christopher Blanchard Date: Sun, 7 Jun 2015 10:20:23 +0100 Subject: [PATCH] Fix for can_create? weirdness --- app/models/issue.rb | 4 ++-- spec/models/issue_spec.rb | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index f31f870..594ddb0 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -99,8 +99,8 @@ class Issue < ActiveRecord::Base cuser and !cuser.nil? and ((author == cuser) or cuser.admin?) end - def can_create? cuser, params = {} - Verification.contain params, [:title, :category_id, :text] + def can_create? cuser + true end def can_update? cuser diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 5912530..dc5f961 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -35,12 +35,9 @@ describe 'User' do expect(issue.can_show? user).to be_false end end - describe 'can_create? is weird and broken' do - it "returns true if no params" do - expect(issue.can_create? user).to be_true - end - it 'returns false if no params' do - expect(issue.can_create? user, {foo: "bar"}).to be_false + describe 'can_create?' do + it "returns true" do + expect(issue.can_create? nil).to be_true end end describe 'can_update?' do