diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-04-29 16:40:46 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-04-29 16:40:46 +0100 |
commit | 4b6cc7d1aa1e7d095e94aad7522385d66314879b (patch) | |
tree | b524b76e719f84359a0a74a56a0372038a8f37ed | |
parent | 2f2415d8d126423c17dd85d29f8fb543b56b946d (diff) |
Remove confusing before block
Next commit adds a new spec; this before block was affecting the
behaviour of the new spec.
https://robots.thoughtbot.com/lets-not
-rw-r--r-- | spec/models/holiday_import_spec.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/models/holiday_import_spec.rb b/spec/models/holiday_import_spec.rb index 21061f63f..59448104e 100644 --- a/spec/models/holiday_import_spec.rb +++ b/spec/models/holiday_import_spec.rb @@ -88,14 +88,14 @@ describe HolidayImport do describe 'when populating a set of holidays to import from suggestions' do - before do - holidays = [ { :date => Date.new(2014, 1, 1), :name => "New Year's Day", :regions => [:gb] } ] + it 'should populate holidays from the suggestions' do + holidays = [ { :date => Date.new(2014, 1, 1), + :name => "New Year's Day", + :regions => [:gb] } ] Holidays.stub!(:between).and_return(holidays) @holiday_import = HolidayImport.new(:source => 'suggestions') @holiday_import.populate - end - it 'should populate holidays from the suggestions' do @holiday_import.holidays.size.should == 1 holiday = @holiday_import.holidays.first holiday.description.should == "New Year's Day" @@ -103,6 +103,13 @@ describe HolidayImport do end it 'should return a flag that it has been populated' do + holidays = [ { :date => Date.new(2014, 1, 1), + :name => "New Year's Day", + :regions => [:gb] } ] + Holidays.stub!(:between).and_return(holidays) + @holiday_import = HolidayImport.new(:source => 'suggestions') + @holiday_import.populate + @holiday_import.populated.should == true end |