show email on profile if wanted

This commit is contained in:
Skud
2013-02-06 16:54:15 +11:00
parent d5327ebbf3
commit 09727d99b2
3 changed files with 27 additions and 4 deletions

View File

@@ -8,7 +8,12 @@
%p
= "Member since: #{@member.created_at.to_s(:date)}"
%p Location: Unknown
%p
Location: Unknown
- if @member.show_email
%p
Email:
= mail_to @member.email
.span9
.tabbable

View File

@@ -11,17 +11,20 @@ FactoryGirl.define do
factory :no_tos_member do
tos_agreement false
# email 'notos@example.com'
end
factory :unconfirmed_member do
confirmed_at nil
# email 'confirmed@example.com'
end
factory :long_name_member do
login_name 'Marmaduke Blundell-Hollinshead-Blundell-Tolemache-Plantagenet-Whistlebinkie, 3rd Duke of Marmoset'
# email 'marmaduke@example.com'
end
# this member has very loose privacy settings
factory :public_member do
login_name 'NothingToHide'
show_email true
end
end

View File

@@ -41,6 +41,10 @@ describe "members/show" do
rendered.should_not contain "Note: these are a random selection"
end
it "doesn't show the email address" do
rendered.should_not contain @member.email
end
context "signed in member" do
before(:each) do
sign_in @member
@@ -52,4 +56,15 @@ describe "members/show" do
end
end
context "public member" do
before(:each) do
@member = FactoryGirl.create(:public_member)
render
end
it "shows the email address" do
rendered.should contain @member.email
end
end
end