diff --git a/spec/services/client_api/teams/create_service_spec.rb b/spec/services/client_api/teams/create_service_spec.rb index 55c083736..954a57b16 100644 --- a/spec/services/client_api/teams/create_service_spec.rb +++ b/spec/services/client_api/teams/create_service_spec.rb @@ -3,11 +3,10 @@ require 'rails_helper' include ClientApi::Teams describe ClientApi::Teams::CreateService do - let(:user) { create :user, email: 'user@asdf.com' } - let(:team) { build :team, - name: 'My Team', - description: 'My Description' } + let(:team) do + build :team, name: 'My Team', description: 'My Description' + end it 'should raise a StandardError if current_user is not assigned' do expect { CreateService.new }.to raise_error(StandardError) @@ -36,7 +35,8 @@ describe ClientApi::Teams::CreateService do service = CreateService.new( current_user: user, - params: { description: team.description }) + params: { description: team.description } + ) result = service.execute expect(result[:status]).to eq :error end @@ -45,7 +45,8 @@ describe ClientApi::Teams::CreateService do team.name = ('a' * (Constants::NAME_MIN_LENGTH - 1)).to_s service = CreateService.new( current_user: user, - params: { name: team.name, description: team.description }) + params: { name: team.name, description: team.description } + ) result = service.execute expect(result[:status]).to eq :error end @@ -54,7 +55,8 @@ describe ClientApi::Teams::CreateService do team.name = ('a' * (Constants::NAME_MAX_LENGTH + 1)).to_s service = CreateService.new( current_user: user, - params: { name: team.name, description: team.description }) + params: { name: team.name, description: team.description } + ) result = service.execute expect(result[:status]).to eq :error end @@ -63,7 +65,8 @@ describe ClientApi::Teams::CreateService do team.description = ('a' * (Constants::TEXT_MAX_LENGTH + 1)).to_s service = CreateService.new( current_user: user, - params: { name: team.name, description: team.description }) + params: { name: team.name, description: team.description } + ) result = service.execute expect(result[:status]).to eq :error end