diff --git a/spec/factories/speaker_profiles.rb b/spec/factories/speaker_profiles.rb index 2e64802..dbabf5a 100644 --- a/spec/factories/speaker_profiles.rb +++ b/spec/factories/speaker_profiles.rb @@ -6,7 +6,7 @@ FactoryGirl.define do last_name "Doe" organisation "Example Org" public_email "a@b.com" - photo_url "http://placehold.it/50x50" + picture { Rack::Test::UploadedFile.new(File.join(Rails.root, 'spec', 'support', 'picture.jpg')) } mobile_phone "0883444555" biography "Lorem ipsum" github "octocat" diff --git a/spec/models/speaker_profile_spec.rb b/spec/models/speaker_profile_spec.rb index 008941d..76453df 100644 --- a/spec/models/speaker_profile_spec.rb +++ b/spec/models/speaker_profile_spec.rb @@ -9,8 +9,8 @@ RSpec.describe SpeakerProfile, :type => :model do expect(build(:speaker_profile, last_name: nil)).to have_error_on :last_name end - it 'is invalid without a photo' do - expect(build(:speaker_profile, photo_url: nil)).to have_error_on :photo_url + it 'is invalid without a picture' do + expect(build(:speaker_profile, picture: nil)).to have_error_on :picture end describe 'mobile_phone' do diff --git a/spec/support/picture.jpg b/spec/support/picture.jpg new file mode 100644 index 0000000..e69de29