Skip to content

Commit

Permalink
remove unused attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Tooyosi committed Mar 11, 2024
1 parent 565e953 commit fe4bdd7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions spec/lib/project_copier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@
expect(copied_project.configuration['source_project_id']).to be(project.id)
end

it "sets the value of each excluded attribute to their default" do
it 'sets the value of each excluded attribute to their default' do
# N.B, to be updated once ProjectCopier::EXCLUDE_ATTRIBUTES values are updated aswell
default_values = [0, 0, nil, 0.0, 0, 0]
default_values = %i[0 0 nil 0.0 0 0]
# excluding launched_row_order and beta_row_order as they are primary keys and don't have a fixed default value
excluded_attributes = ProjectCopier::EXCLUDE_ATTRIBUTES.reject { |attr| [:launched_row_order, :beta_row_order].include?(attr) }
attribute_values_pair = excluded_attributes.zip(default_values).to_h
attribute_values_pair.each_with_index do |(key, value), i|
excluded_attributes.each_with_index do |key, i|
expect(copied_project[key]).to be(default_values[i])
end
end

it "checks the type of excluded primary keys" do
it 'checks the type of excluded primary keys' do
ranked_attributes = %i[launched_row_order beta_row_order]
ranked_attributes.each do |value|
expect(copied_project[value]).to be_kind_of(Integer)
Expand Down

0 comments on commit fe4bdd7

Please sign in to comment.