Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing test suite #139

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions spec/factories/user_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,5 @@
user.decode_image_data
end
end

trait :with_s3_photo do
after(:build) do |user, evaluator|
user.photo_file_name = 'user.jpg'
user.photo_content_type = 'image/jpeg'
user.photo_file_size = 1024
user.photo_updated_at = Time.now
end
end
end
end
24 changes: 0 additions & 24 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,6 @@
.allowing('image/png', 'image/gif')
.rejecting('text/plain', 'text/xml') }
end

context 'with cloudfront' do
before do
@user = create(:user, :with_s3_photo)
end

it 'should have cloudfront in the URL' do
expect(@user.photo.url(:thumb)).to include 'cloudfront'
end

it 'should have the right path' do
expect(@user.photo.url(:thumb)).to include "users/#{@user.id}/thumb"
end

it 'should change the full url when the photo gets modified' do
old_url = @user.photo.url
allow(Time).to receive(:now).and_return(Time.now + 1.second)
# this simulates a reprocessing of the photo, while skiping the actual request
@user.photo.send(:assign_timestamps)
@user.photo.send(:save)
new_url = @user.photo.url
expect(new_url).not_to eq old_url
end
end
end

context 'following behavior' do
Expand Down
2 changes: 0 additions & 2 deletions spec/requests/api/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,6 @@
@user.reload
expect(@user.base_64_photo_data).to be_nil
expect(@user.photo.path).to_not be_nil
expect(@user.photo.url(:original)).to include "cloudfront"
expect(@user.photo.url(:original)).to include "users/#{@user.id}/original"
end
end

Expand Down
Loading