Sha256: 1d27d49ff0967e5c1c7008ce35078d913f18bab3107b5e96fdb224dab0af98d0
Contents?: true
Size: 1.58 KB
Versions: 7
Compression:
Stored size: 1.58 KB
Contents
require "spec_helper" require 'action_controller' require "rails-footnotes/notes/assigns_note" describe Footnotes::Notes::AssignsNote do let(:note) do @controller = double @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"], ["<strong>@action_has_layout</strong><br /><em>TrueClass</em>", "true"], ["<strong>@status</strong><br /><em>Fixnum</em>", "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"], ["<strong>@action_has_layout</strong><br /><em>TrueClass</em>", "true"], ["<strong>@status</strong><br /><em>Fixnum</em>", "200"] ], {:summary=>"Debug information for Assigns (2)"}) note.content end end
Version data entries
7 entries across 7 versions & 1 rubygems