mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Hound is love, Hound is life
This commit is contained in:
parent
a14457cba0
commit
e0a6b1360d
1 changed files with 11 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue