# Updating the description should work
put profile_path, :params => { :user => { :description => "new description" } }
# Updating the description should work
put profile_path, :params => { :user => { :description => "new description" } }
assert_select "div", "new description"
# Changing to an uploaded image should work
image = Rack::Test::UploadedFile.new("test/gpx/fixtures/a.gif", "image/gif")
put profile_path, :params => { :avatar_action => "new", :user => { :avatar => image, :description => user.description } }
assert_select "div", "new description"
# Changing to an uploaded image should work
image = Rack::Test::UploadedFile.new("test/gpx/fixtures/a.gif", "image/gif")
put profile_path, :params => { :avatar_action => "new", :user => { :avatar => image, :description => user.description } }
get edit_profile_path
assert_select "form > fieldset > div > div.col-sm-10 > div.form-check > input[name=avatar_action][checked][value=?]", "keep"
# Changing to a gravatar image should work
put profile_path, :params => { :avatar_action => "gravatar", :user => { :description => user.description } }
get edit_profile_path
assert_select "form > fieldset > div > div.col-sm-10 > div.form-check > input[name=avatar_action][checked][value=?]", "keep"
# Changing to a gravatar image should work
put profile_path, :params => { :avatar_action => "gravatar", :user => { :description => user.description } }
get edit_profile_path
assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked][value=?]", "gravatar"
# Removing the image should work
put profile_path, :params => { :avatar_action => "delete", :user => { :description => user.description } }
get edit_profile_path
assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked][value=?]", "gravatar"
# Removing the image should work
put profile_path, :params => { :avatar_action => "delete", :user => { :description => user.description } }
get edit_profile_path
assert_select "form > fieldset > div > div.col-sm-10 > div > input[name=avatar_action][checked]", false
assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked]", false
get edit_profile_path
assert_select "form > fieldset > div > div.col-sm-10 > div > input[name=avatar_action][checked]", false
assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked]", false