diff --git a/spec/services/repository_table_state_column_update_service_spec.rb b/spec/services/repository_table_state_column_update_service_spec.rb index b3e50c9b7..982c4694a 100644 --- a/spec/services/repository_table_state_column_update_service_spec.rb +++ b/spec/services/repository_table_state_column_update_service_spec.rb @@ -247,7 +247,7 @@ describe RepositoryTableStateColumnUpdateService do it 'should keep columns as they were' do 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( initial_state_1.state.merge('columns' => cols_1) ) @@ -367,4 +367,4 @@ describe RepositoryTableStateColumnUpdateService do ) end end -end \ No newline at end of file +end diff --git a/spec/services/repository_table_state_service_spec.rb b/spec/services/repository_table_state_service_spec.rb index 4a8a84c08..56e2075e0 100644 --- a/spec/services/repository_table_state_service_spec.rb +++ b/spec/services/repository_table_state_service_spec.rb @@ -36,11 +36,7 @@ describe RepositoryTableStateService do describe '#create_default_state' do let!(:initial_state) do - RepositoryTableState.create( - user: user, - repository: repository, - state: {} - ) + RepositoryTableStateService.new(user, repository).create_default_state end context('record counts') do @@ -75,12 +71,7 @@ describe RepositoryTableStateService do describe '#load_state' do it 'should load initial state if it exists' do - initial_state = RepositoryTableState.create( - user: user, - repository: repository, - state: {} - ) - + initial_state = RepositoryTableStateService.new(user, repository).create_default_state record = service.load_state expect(record).to eq initial_state end @@ -108,4 +99,4 @@ describe RepositoryTableStateService do expect(record.state).to eq new_state end end -end \ No newline at end of file +end