Skip to content

Commit

Permalink
fix bulk update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Sep 5, 2024
1 parent 30154f9 commit 5fd549a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/requests/models_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@
it "updates models creator", :as_moderator do # rubocop:todo RSpec/ExampleLength, RSpec/MultipleExpectations
models = library.models.take(2)
update = {}
update[models[0].id] = 1
update[models[1].id] = 1
update[models[0].to_param] = 1
update[models[1].to_param] = 1

patch "/models/update", params: {models: update, creator_id: creator.to_param}
patch "/models/update", params: {models: update, creator_id: creator.id}

expect(response).to have_http_status(:redirect)
models.each { |model| model.reload }
Expand All @@ -133,7 +133,7 @@
it "adds tags to models", :as_moderator do # rubocop:todo RSpec/ExampleLength, RSpec/MultipleExpectations
update = {}
library.models.take(2).each do |model|
update[model.id] = 1
update[model.to_param] = 1
end

patch "/models/update", params: {models: update, add_tags: ["a", "b", "c"]}
Expand All @@ -149,7 +149,7 @@
library.models.take(2).each do |model|
model.tag_list = "a, b, c"
model.save
update[model.id] = 1
update[model.to_param] = 1
end

patch "/models/update", params: {models: update, remove_tags: ["a", "b"]}
Expand Down

0 comments on commit 5fd549a

Please sign in to comment.