Hi Sergion
Test Failed at:
Minitest::UnexpectedError: NoMethodError: undefined method `level' for
nil:NilClass
app/models/fas4gst4sql.rb:11:in `authorized_for_delete?'
test/controllers/fas4gst4sqls_controller_test.rb:43:in `block (2
levels) in <class:Fas4gst4sqlsControllerTest>'
test/controllers/fas4gst4sqls_controller_test.rb:42:in `block in
<class:Fas4gst4sqlsControllerTest>'
app/models/fas4gst4sql.rb:11:in `authorized_for_delete?'
test/controllers/fas4gst4sqls_controller_test.rb:43:in `block (2 levels) in
<class:Fas4gst4sqlsControllerTest>'
test/controllers/fas4gst4sqls_controller_test.rb:42:in `block in
<class:Fas4gst4sqlsControllerTest>'
*class Fas4gst4sql < ApplicationRecord*belongs_to :priority
belongs_to :rootcause
validates :feature, presence:true, uniqueness:true
# active_scaffold security feature
def authorized_for_delete?
* if current_user.level > 0* false
else
true
end
end
class Fas4gst4sqlsControllerTest < ActionDispatch::IntegrationTest
setup do
@fas4gst4sql = fas4gst4sqls(:one)
end
test "should destroy fas4gst4sql" do
assert_difference('Fas4gst4sql.count', -1) do
delete fas4gst4sql_url(@fas4gst4sql)
end
How can I make the test pass ?
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.