diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 7997fb57..e9a315d8 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -1,4 +1,5 @@ CarrierWave.configure do |config| config.storage = :file config.cache_dir = "#{Rails.root}/tmp/uploads" + config.enable_processing = false if Rails.env.test? end diff --git a/spec/factories/sponsors.rb b/spec/factories/sponsors.rb index 961cb77f..51fcc183 100644 --- a/spec/factories/sponsors.rb +++ b/spec/factories/sponsors.rb @@ -5,11 +5,14 @@ FactoryGirl.define do name 'Example sponsor' website_url 'http://www.example.com' description 'Lorem Ipsum Dolor' - logo_file_name 'rails.jpg' - logo_file_size 2000 - logo_content_type 'image/jpeg' - logo_updated_at DateTime.current sponsorship_level conference + + after(:create) do |sponsor| + uploader = PictureUploader.new(sponsor, :picture) + File.open('app/assets/images/rails.png') { |f| uploader.store!(f) } + sponsor.logo_file_name = 'rails.png' + sponsor.save + end end end diff --git a/spec/features/lodgings_spec.rb b/spec/features/lodgings_spec.rb index 9bcaad6a..0731eff6 100644 --- a/spec/features/lodgings_spec.rb +++ b/spec/features/lodgings_spec.rb @@ -16,7 +16,7 @@ feature Lodging do fill_in 'lodging_name', with: 'New lodging' fill_in 'lodging_website_link', with: 'http:\\www.google.com' - attach_file 'Photo', path + attach_file 'Picture', path click_button 'Create Lodging' @@ -42,7 +42,7 @@ feature Lodging do fill_in 'lodging_name', with: 'New lodging' fill_in 'lodging_website_link', with: 'http:\\www.google.com' - attach_file 'Photo', path + attach_file 'Picture', path click_button 'Update Lodging' diff --git a/spec/features/sponsor_spec.rb b/spec/features/sponsor_spec.rb index b0454a52..df527ede 100644 --- a/spec/features/sponsor_spec.rb +++ b/spec/features/sponsor_spec.rb @@ -19,7 +19,7 @@ feature Sponsor do fill_in 'sponsor_name', with: 'SUSE' fill_in 'sponsor_description', with: 'The original provider of the enterprise Linux distribution' - attach_file 'Logo', path + attach_file 'Picture', path fill_in 'sponsor_website_url', with: 'http://www.suse.com' select('Platin', from: 'sponsor_sponsorship_level_id') diff --git a/spec/helpers/sponsor_helper_spec.rb b/spec/helpers/sponsor_helper_spec.rb index 492f9df5..ec9aff06 100644 --- a/spec/helpers/sponsor_helper_spec.rb +++ b/spec/helpers/sponsor_helper_spec.rb @@ -11,7 +11,7 @@ describe SponsorsHelper, type: :helper do end it 'returns correct url' do - expect(get_logo(sponsor)).to match %r{.*(\bfirst/rails.jpg\b)} + expect(get_logo(sponsor)).to match %r{.*(\bfirst/rails.png\b)} end end @@ -22,7 +22,7 @@ describe SponsorsHelper, type: :helper do end it 'returns correct url' do - expect(get_logo(sponsor)).to match %r{.*(\bsecond/rails.jpg\b)} + expect(get_logo(sponsor)).to match %r{.*(\bsecond/rails.png\b)} end end @@ -33,7 +33,7 @@ describe SponsorsHelper, type: :helper do end it 'returns correct url' do - expect(get_logo(sponsor)).to match %r{.*(\bothers/rails.jpg\b)} + expect(get_logo(sponsor)).to match %r{.*(\bothers/rails.png\b)} end end end diff --git a/spec/serializers/conference_serializer_spec.rb b/spec/serializers/conference_serializer_spec.rb index a7d52a52..1de2f887 100644 --- a/spec/serializers/conference_serializer_spec.rb +++ b/spec/serializers/conference_serializer_spec.rb @@ -16,7 +16,7 @@ describe ConferenceSerializer, type: :serializer do description: 'Lorem ipsum dolor sit', start_date: '2014-03-04', end_date: '2014-03-10', - logo: '/logos/original/missing.png', + picture_url: nil, difficulty_levels: [{id: 1, title: 'Easy', diff --git a/spec/views/conference/show.html.haml_spec.rb b/spec/views/conference/show.html.haml_spec.rb index 04951b64..18d485eb 100644 --- a/spec/views/conference/show.html.haml_spec.rb +++ b/spec/views/conference/show.html.haml_spec.rb @@ -60,7 +60,7 @@ describe 'conference/show.html.haml' do expect(rendered).to match(/example@example.com/) expect(rendered).to match(/www.example.com/) expect(rendered).to match(/Lorem Ipsum Dolor/) - expect(rendered).to match(/rails.jpg/) + expect(rendered).to match(/rails.png/) end it 'renders social media partial' do