diff --git a/spec/lib/name_copy_naming_algorithm_spec.rb b/spec/lib/name_copy_naming_algorithm_spec.rb index 6cb16334..b506d8b6 100644 --- a/spec/lib/name_copy_naming_algorithm_spec.rb +++ b/spec/lib/name_copy_naming_algorithm_spec.rb @@ -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 diff --git a/spec/lib/slug_copy_naming_algorithm_spec.rb b/spec/lib/slug_copy_naming_algorithm_spec.rb index 22a6bb0f..67cabeec 100644 --- a/spec/lib/slug_copy_naming_algorithm_spec.rb +++ b/spec/lib/slug_copy_naming_algorithm_spec.rb @@ -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 diff --git a/spec/lib/slug_nonprofit_naming_algorithm_spec.rb b/spec/lib/slug_nonprofit_naming_algorithm_spec.rb index 9afa701a..2a58055f 100644 --- a/spec/lib/slug_nonprofit_naming_algorithm_spec.rb +++ b/spec/lib/slug_nonprofit_naming_algorithm_spec.rb @@ -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