Sha256: 42ba63048eda78f3202df9e602540c92b69b8eed8261f957a3f52af55c07bf23
Contents?: true
Size: 1.38 KB
Versions: 2
Compression:
Stored size: 1.38 KB
Contents
require "spec_helper" require 'action_controller' require "rails-footnotes/notes/assigns_note" describe Footnotes::Notes::AssignsNote do let(:note) do @controller = mock @controller.stub(:instance_variables).and_return([:@action_has_layout, :@status]) @controller.instance_variable_set(:@action_has_layout, true) @controller.instance_variable_set(:@status, 200) Footnotes::Notes::AssignsNote.new(@controller) end subject {note} before(:each) {Footnotes::Notes::AssignsNote.ignored_assigns = []} it {should be_valid} its(:title) {should eql 'Assigns (2)'} specify {note.send(:assigns).should eql [:@action_has_layout, :@status]} specify {note.send(:to_table).should eql [['Name', 'Value'], [:@action_has_layout, "true"], [:@status, "200"]]} describe "Ignored Assigns" do before(:each) {Footnotes::Notes::AssignsNote.ignored_assigns = [:@status]} it {note.send(:assigns).should_not include :@status} end describe "Ignored Assigns by regexp" do before(:each) {Footnotes::Notes::AssignsNote.ignored_assigns_pattern = /^@status$/} it {note.send(:assigns).should_not include :@status} end it "should call #mount_table method with correct params" do note.should_receive(:mount_table).with( [['Name', 'Value'], [:@action_has_layout, "true"], [:@status, "200"]], {:summary=>"Debug information for Assigns (2)"}) note.content end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rails-footnotes-3.7.9 | spec/notes/assigns_note_spec.rb |
rails-footnotes-3.7.8 | spec/notes/assigns_note_spec.rb |