Adapt the spec

This commit is contained in:
Henne Vogelsang 2016-04-27 17:34:17 +02:00
parent 86896cc46b
commit 8fc57e34c9
7 changed files with 16 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -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'

View file

@ -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')

View file

@ -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

View file

@ -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',

View file

@ -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