Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
require "rails_helper"
RSpec.describe AccountSessionsController, type: :controller do
let(:second_account) { create(:account) }
let(:current_user) { create(:user) }
before do
AccountAuth.create(user: current_user, account: second_account, role: :account_manager)
sign_in current_user
end
describe "#update" do
it "responds successfully" do
post :update, params: { account_session: account_sessions_params(second_account) }
expect(response).to redirect_to signed_in_root_path
end
end
private
def account_sessions_params(account)
{ account_id: account.id }
end
end