Sha256: 0676ad130e6665db4b6b865227fcfc5428fe3c36891f0c804365b64e3834d000

Contents?: true

Size: 683 Bytes

Versions: 2

Compression:

Stored size: 683 Bytes

Contents

require 'spec_helper'

describe Spree::Account::FavouritesController do

  describe "index" do

    let(:complete_orders) { double(Array) }
    let(:user_orders) { double(Array, complete: complete_orders) }
    let(:user) { mock_model Spree::User, :last_incomplete_spree_order => nil, :has_spree_role? => true, :spree_api_key => 'fake', :orders => user_orders }

    before :each do
      controller.stub :spree_current_user => user
      controller.stub :check_authorization
    end

    it 'should redirect to login if user is not logged in' do
      controller.stub(:spree_current_user).and_return nil
      spree_get :index
      response.status.should == 401
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_my_favourites-2.2.2 spec/controllers/spree/account/favourites_controller_spec.rb
spree_my_favourites-2.2.1 spec/controllers/spree/account/favourites_controller_spec.rb