} context "when logged in" do before { context.stub :logged_in? => true } it { expect(menu.to_partial_path).to eq("shared/menu_logged") } end context "when unlogged" do before { context.stub :logged_in? => false } it { expect(menu.to_partial_path).to eq("shared/menu_unlogged") } end end