Commit d8db9e10 authored by Luke Duncalfe's avatar Luke Duncalfe

Correct event data for design import

And adding a missing spec for the event data.
parent cbc8d5c1
......@@ -153,7 +153,7 @@
{
"design_id":38,
"version_id":25,
"event":0,
"event":1,
"design":{
"id":38,
"project_id":30,
......@@ -183,7 +183,7 @@
{
"design_id":38,
"version_id":26,
"event":0,
"event":1,
"design":{
"id":38,
"project_id":30,
......@@ -194,7 +194,7 @@
{
"design_id":39,
"version_id":26,
"event":0,
"event":2,
"design":{
"id":39,
"project_id":30,
......@@ -366,7 +366,7 @@
{
"design_id":42,
"version_id":29,
"event":0,
"event":1,
"design":{
"id":42,
"project_id":30,
......
......@@ -30,15 +30,16 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
describe 'restores issue associations correctly' do
let(:issue) { project.issues.offset(index).first }
where(:index, :design_filenames, :version_shas, :author_usernames) do
0 | %w[chirrido3.jpg jonathan_richman.jpg mariavontrap.jpeg] | %w[27702d08f5ee021ae938737f84e8fe7c38599e85 9358d1bac8ff300d3d2597adaa2572a20f7f8703 e1a4a501bcb42f291f84e5d04c8f927821542fb6] | %w[user_1 user_1 user_2]
1 | ['1 (1).jpeg', '2099743.jpg', 'a screenshot (1).jpg', 'chirrido3.jpg'] | %w[73f871b4c8c1d65c62c460635e023179fb53abc4 8587e78ab6bda3bc820a9f014c3be4a21ad4fcc8 c9b5f067f3e892122a4b12b0a25a8089192f3ac8] | %w[user_1 user_2 user_2]
where(:index, :design_filenames, :version_shas, :events, :author_usernames) do
0 | %w[chirrido3.jpg jonathan_richman.jpg mariavontrap.jpeg] | %w[27702d08f5ee021ae938737f84e8fe7c38599e85 9358d1bac8ff300d3d2597adaa2572a20f7f8703 e1a4a501bcb42f291f84e5d04c8f927821542fb6] | %w[creation creation creation modification modification deletion] | %w[user_1 user_1 user_2]
1 | ['1 (1).jpeg', '2099743.jpg', 'a screenshot (1).jpg', 'chirrido3.jpg'] | %w[73f871b4c8c1d65c62c460635e023179fb53abc4 8587e78ab6bda3bc820a9f014c3be4a21ad4fcc8 c9b5f067f3e892122a4b12b0a25a8089192f3ac8] | %w[creation creation creation creation modification] | %w[user_1 user_2 user_2]
end
with_them do
it do
expect(issue.designs.pluck(:filename)).to contain_exactly(*design_filenames)
expect(issue.design_versions.pluck(:sha)).to contain_exactly(*version_shas)
expect(issue.design_versions.flat_map(&:actions).map(&:event)).to contain_exactly(*events)
expect(issue.design_versions.map(&:author).map(&:username)).to contain_exactly(*author_usernames)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment