Copy naming algorithms not longer run full max copy tests. This shortens test times by a significant amount without reducing coverage that much

This commit is contained in:
Eric Schultz 2018-12-10 13:24:35 -06:00
parent 111d7c03bc
commit 6fb2721a08
3 changed files with 10 additions and 71 deletions

View file

@ -61,20 +61,8 @@ describe NameCopyNamingAlgorithm do
expect(algo.create_copy_name(@name2)).to eq short_name_copy_today
end
it 'errors when at max copies' do
@name = short_name
@copy_base = short_name_copy_today_base
event
events_at_max_copies
expect{ algo.create_copy_name(@name) }.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
events_at_max_copies.each {|i|
expect {algo.create_copy_name(i.name)}.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
}
it 'has 30 as max copies' do
expect(algo.max_copies).to eq 30
end
end
@ -105,20 +93,8 @@ describe NameCopyNamingAlgorithm do
end
it 'errors when at max copies' do
@name = long_name
@copy_base = long_name_copy_today_base
event
events_at_max_copies
expect{ algo.create_copy_name(@name) }.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
events_at_max_copies.each {|i|
expect {algo.create_copy_name(i.name)}.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
}
it 'has 30 as max copies' do
expect(algo.max_copies).to eq 30
end
end

View file

@ -47,20 +47,8 @@ describe SlugCopyNamingAlgorithm do
expect(algo.create_copy_name(@name2)).to eq short_slug_copy_today_plus_1
end
it 'errors when at max copies' do
@name = short_slug
@copy_base = copy_base
event
events_at_max_copies
expect{ algo.create_copy_name(@name) }.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
events_at_max_copies.each {|i|
expect {algo.create_copy_name(i.slug)}.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
}
it 'has 30 as max copies' do
expect(algo.max_copies).to eq 30
end
end
@ -91,20 +79,8 @@ describe SlugCopyNamingAlgorithm do
expect(algo.create_copy_name(@name2)).to eq short_slug_copy_today_plus_1
end
it 'errors when at max copies' do
@name = short_slug
@copy_base = copy_base
campaign
campaigns_at_max_copies
expect{ algo.create_copy_name(@name) }.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
campaigns_at_max_copies.each {|i|
expect {algo.create_copy_name(i.slug)}.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
}
it 'has 30 as max copies' do
expect(algo.max_copies).to eq 30
end

View file

@ -54,21 +54,8 @@ describe SlugNonprofitNamingAlgorithm do
expect(algo.create_copy_name(@name2)).to eq short_slug_copy_today_plus_1
end
it 'errors when at max copies' do
@name = short_slug
@copy_base = copy_base
nonprofit
nonprofit_at_max_copies
nonprofit_in_other_city
nonprofit_in_other_state
expect{ algo.create_copy_name(@name) }.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
nonprofit_at_max_copies.each {|i|
expect {algo.create_copy_name(i.slug)}.to(raise_error{|error|
expect(error).to be_a ArgumentError
})
}
it 'it has 99 as max copies' do
expect(algo.max_copies).to eq 99
end