master
1require "rails_helper"
2
3describe "uploading an avatar", js: true do
4 let(:user) { create(:user, :password => "password") }
5 let(:file) { File.expand_path(File.join(Rails.root, '/spec/fixtures/images/gorilla.jpg')) }
6
7 before { http_login(user) }
8
9 it "displays a success message" do
10 visit new_my_avatar_path
11 within(".new_photo") do
12 attach_file('photo_image', file)
13 end
14 click_button "Upload picture"
15 expect(page).to have_content(I18n.t(:avatar_uploaded))
16 end
17end