spec/controllers/dashboard_controller_spec.rb in sufia-6.2.0 vs spec/controllers/dashboard_controller_spec.rb in sufia-6.3.0

- old
+ new

@@ -1,8 +1,8 @@ require 'spec_helper' -describe DashboardController, :type => :controller do +describe DashboardController, type: :controller do context "with an unauthenticated user" do it "redirects to sign-in page" do get :index expect(response).to be_redirect expect(flash[:alert]).to eq("You need to sign in or sign up before continuing.") @@ -34,15 +34,15 @@ context 'with transfers' do let(:another_user) { FactoryGirl.find_or_create(:archivist) } context 'when incoming' do let!(:incoming_file) do - GenericFile.new.tap do |f| - f.apply_depositor_metadata(another_user.user_key) - f.save! - f.request_transfer_to(user) - end + GenericFile.new.tap do |f| + f.apply_depositor_metadata(another_user.user_key) + f.save! + f.request_transfer_to(user) + end end it 'assigns an instance variable' do get :index expect(response).to be_success @@ -51,15 +51,15 @@ end end context 'when outgoing' do let!(:outgoing_file) do - GenericFile.new.tap do |f| - f.apply_depositor_metadata(user.user_key) - f.save! - f.request_transfer_to(another_user) - end + GenericFile.new.tap do |f| + f.apply_depositor_metadata(user.user_key) + f.save! + f.request_transfer_to(another_user) + end end it 'assigns an instance variable' do get :index expect(response).to be_success @@ -72,10 +72,10 @@ context "with activities" do let(:activity) { double } before do allow(activity).to receive(:map).and_return(activity) - allow_any_instance_of(User).to receive(:get_all_user_activity).and_return(activity) + allow_any_instance_of(User).to receive(:all_user_activity).and_return(activity) end it "gathers the user's recent activity within the default amount of time" do get :index expect(assigns(:activity)).to eq activity