aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-07-15 16:20:11 +0100
committerFrancis Irving <francis@mysociety.org>2010-07-15 16:20:11 +0100
commit0c1883dff22c1433f33944ece9f7625c26f1b123 (patch)
tree8d110ec8169654c366f804e00b3cb076d1a47e73
parentc5067bb626fea89a0e2f9982d417a39c854d3305 (diff)
Fix HTML nesting
-rw-r--r--app/views/user/show.rhtml17
-rw-r--r--spec/controllers/user_controller_spec.rb4
2 files changed, 12 insertions, 9 deletions
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index 1aeb58391..d9898972e 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -63,16 +63,19 @@
<%= link_to "Send message to " + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
<% if @is_you %>
(just to see how it works)
- <p id="user_change_password_email">
- <% if @display_user.profile_photo %>
- <%= link_to "Change profile photo", set_profile_photo_url() %> |
- <% end %>
- <%= link_to "Change your password", signchangepassword_url() %> |
- <%= link_to "Change your email", signchangeemail_url() %>
- </p>
<% end %>
</p>
+ <% if @is_you %>
+ <p id="user_change_password_email">
+ <% if @display_user.profile_photo %>
+ <%= link_to "Change profile photo", set_profile_photo_url() %> |
+ <% end %>
+ <%= link_to "Change your password", signchangepassword_url() %> |
+ <%= link_to "Change your email", signchangeemail_url() %>
+ </p>
+ <% end %>
+
<% if not @is_you %>
<p>
If you are <%=h @display_user.name %>, <%= link_to "sign in", signin_url(:r => request.request_uri) %> to change your password or alter your subscriptions.
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index 5c2893aaa..18c376642 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -468,14 +468,14 @@ describe UserController, "when using profile photos" do
end
it "should not let you change profile photo if you're not logged in as the user" do
- post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_profile_photo => 1, :automatically_crop => 1 }
+ post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_draft_profile_photo => 1, :automatically_crop => 1 }
end
it "should let you change profile photo if you're logged in as the user" do
@user.profile_photo.should be_nil
session[:user_id] = @user.id
- post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_profile_photo => 1, :automatically_crop => 1 }
+ post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_draft_profile_photo => 1, :automatically_crop => 1 }
response.should redirect_to(:controller => 'user', :action => 'show', :url_name => "bob_smith")
flash[:notice].should match(/Thank you for updating your profile photo/)