を実行しているアクションフォームを停止しませんfalseを返す前に、私はこれを実行します。RoRの:フィルターは私のテストで
delete :destroy, :id => p.id
assert_equal "You do not have permission to delete this Object.", flash[:error]
Object.find_by_id(p.id).should_not be_nil #line 48 (reffed by console output below)
と私の前にフィルターを、プットを持っているので、私はdoesnの結果が偽である知っている、と」トンこのページによると
before_filter lambda { |controller|
result = controller.is_object_on_same_account_as_current_account_for_id?(
controller_name.classify.constantize,
controller.params[:id])
puts result
return if result
}, :only => [:destroy]
戻る:http://citizen428.net/archives/846、フィルターに縛らアクションは、フィルタのみが戻る場合に実行されています。ここで何が起こっている
Started
false
F
Finished in 0.865708 seconds.
1) Failure:
test: .... ...
blah blah, issue is on line 48
shoulda (2.11.3) lib/shoulda/context.rb:382:in `...']:
expected: not nil
got: nil
そう...:
そして、ここでは、コンソール出力されますか?私は完全に無知だ。
関連のコード:
def destroy
@content.destroy
ない、私は1つのテストのみを実行していること:
は、メソッドを破壊します。
ポイントを、そしてより多くの*詳細を提供:
だから、あなたはおそらくしたいと思います。 –
私は、行48をしました。 – DerNalia