spec/lib/railsthemes/email_installer_spec.rb in railsthemes-1.2.0 vs spec/lib/railsthemes/email_installer_spec.rb in railsthemes-2.0.0.pre
- old
+ new
@@ -7,41 +7,31 @@
@installer = Railsthemes::EmailInstaller.new
@tempdir = stub_tempdir
end
describe '#install_mail_gems_if_necessary' do
- it 'should install no new gems if premailer-rails3 gem already installed' do
- File.open('Gemfile.lock', 'w') do |f|
- f.write using_gems 'premailer-rails3', 'hpricot'
- end
+ it 'should install no new gems if premailer-rails gem already installed' do
+ write_gemfiles_using_gems 'premailer-rails', 'hpricot'
dont_allow(Railsthemes::Utils).add_gem_to_gemfile(anything)
- dont_allow(Railsthemes::Safe).system_call('bundle')
@installer.install_mail_gems_if_necessary
end
- it 'when nokogiri already installed, should install the pr3 gem' do
- File.open('Gemfile.lock', 'w') do |f|
- f.write using_gems 'nokogiri'
- end
- mock(Railsthemes::Utils).add_gem_to_gemfile('premailer-rails3')
- mock(Railsthemes::Safe).system_call('bundle')
+ it 'when nokogiri already installed, should install the pr gem' do
+ write_gemfiles_using_gems 'nokogiri'
+ mock(Railsthemes::Utils).add_gem_to_gemfile('premailer-rails')
@installer.install_mail_gems_if_necessary
end
- it 'when hpricot already installed, should install the pr3 gem only' do
- File.open('Gemfile.lock', 'w') do |f|
- f.write using_gems 'hpricot'
- end
- mock(Railsthemes::Utils).add_gem_to_gemfile('premailer-rails3')
- mock(Railsthemes::Safe).system_call('bundle')
+ it 'when hpricot already installed, should install the pr gem only' do
+ write_gemfiles_using_gems 'hpricot'
+ mock(Railsthemes::Utils).add_gem_to_gemfile('premailer-rails')
@installer.install_mail_gems_if_necessary
end
- it 'when no xml gem or pr3 installed, should install the pr3 gem and hpricot' do
+ it 'when no xml gem or pr installed, should install the pr gem and hpricot' do
FileUtils.touch('Gemfile.lock')
mock(Railsthemes::Utils).add_gem_to_gemfile('hpricot')
- mock(Railsthemes::Utils).add_gem_to_gemfile('premailer-rails3')
- mock(Railsthemes::Safe).system_call('bundle')
+ mock(Railsthemes::Utils).add_gem_to_gemfile('premailer-rails')
@installer.install_mail_gems_if_necessary
end
end
end