Move create test into a describe block

This commit is contained in:
Karina Kwiatek 2023-01-02 09:15:51 +01:00
parent 0f01177c67
commit f80d4ce935
1 changed files with 32 additions and 30 deletions

View File

@ -3,6 +3,9 @@
require "rails_helper"
describe ServicesController, type: :controller do
describe "#create" do
subject { get :create, params: { provider: "twitter" } }
context "successful Twitter sign in" do
let(:user) { FactoryBot.create(:user) }
@ -22,8 +25,6 @@ describe ServicesController, type: :controller do
OmniAuth.config.mock_auth[:twitter] = nil
end
subject { get :create, params: { provider: "twitter" } }
context "no services connected" do
it "creates a service integration" do
expect { subject }.to change { Service.count }.by(1)
@ -40,8 +41,9 @@ describe ServicesController, type: :controller do
end
end
end
end
context "#update" do
describe "#update" do
subject { patch :update, params: }
context "not signed in" do