mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 15:45:34 +08:00
Fix failing tests [SCI-3412]
This commit is contained in:
parent
5a9640c5d1
commit
0fd7a4e8f1
2 changed files with 5 additions and 14 deletions
|
@ -247,7 +247,7 @@ describe RepositoryTableStateColumnUpdateService do
|
||||||
|
|
||||||
it 'should keep columns as they were' do
|
it 'should keep columns as they were' do
|
||||||
cols_1 = initial_state_1.state['columns'].deep_dup
|
cols_1 = initial_state_1.state['columns'].deep_dup
|
||||||
cols_1['3']['visible'] = 'false'
|
cols_1['4']['visible'] = 'false'
|
||||||
RepositoryTableStateService.new(user_1, repository).update_state(
|
RepositoryTableStateService.new(user_1, repository).update_state(
|
||||||
initial_state_1.state.merge('columns' => cols_1)
|
initial_state_1.state.merge('columns' => cols_1)
|
||||||
)
|
)
|
||||||
|
@ -367,4 +367,4 @@ describe RepositoryTableStateColumnUpdateService do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,11 +36,7 @@ describe RepositoryTableStateService do
|
||||||
|
|
||||||
describe '#create_default_state' do
|
describe '#create_default_state' do
|
||||||
let!(:initial_state) do
|
let!(:initial_state) do
|
||||||
RepositoryTableState.create(
|
RepositoryTableStateService.new(user, repository).create_default_state
|
||||||
user: user,
|
|
||||||
repository: repository,
|
|
||||||
state: {}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context('record counts') do
|
context('record counts') do
|
||||||
|
@ -75,12 +71,7 @@ describe RepositoryTableStateService do
|
||||||
|
|
||||||
describe '#load_state' do
|
describe '#load_state' do
|
||||||
it 'should load initial state if it exists' do
|
it 'should load initial state if it exists' do
|
||||||
initial_state = RepositoryTableState.create(
|
initial_state = RepositoryTableStateService.new(user, repository).create_default_state
|
||||||
user: user,
|
|
||||||
repository: repository,
|
|
||||||
state: {}
|
|
||||||
)
|
|
||||||
|
|
||||||
record = service.load_state
|
record = service.load_state
|
||||||
expect(record).to eq initial_state
|
expect(record).to eq initial_state
|
||||||
end
|
end
|
||||||
|
@ -108,4 +99,4 @@ describe RepositoryTableStateService do
|
||||||
expect(record.state).to eq new_state
|
expect(record.state).to eq new_state
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue