mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-21 06:24:22 -04:00
Added bio to the member profile
This commit is contained in:
1 parent
0d5b2bbcce
commit
07efe0dc8d
5 files changed
+38
No files matched your search
@@ -39,6 +39,10 @@
|
||||
=f.text_field :location
|
||||
%span.help-inline This will be displayed on a map. You can be as detailed or vague as you like.
|
||||
|
||||
.control-group
|
||||
=f.label :bio, :class => 'control-label'
|
||||
.controls
|
||||
=f.text_area :bio, :rows => 6, :class => 'input-block-level'
|
||||
|
||||
%h2 Linked accounts
|
||||
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
- if can? :update, @member
|
||||
%p
|
||||
= link_to 'Edit your profile', "edit", :class => 'btn btn-primary'
|
||||
- if @member.bio
|
||||
%h2 Bio
|
||||
:markdown
|
||||
#{ strip_tags @member.bio }
|
||||
%h2 Gardens
|
||||
.tabbable
|
||||
%ul.nav.nav-tabs
|
||||
- first_garden = true
|
||||
|
||||
@@ -9,11 +9,16 @@ FactoryGirl.define do
|
||||
tos_agreement true
|
||||
confirmed_at Time.now
|
||||
show_email false
|
||||
bio 'I love seeds'
|
||||
|
||||
factory :no_tos_member do
|
||||
tos_agreement false
|
||||
end
|
||||
|
||||
factory :no_bio_member do
|
||||
bio nil
|
||||
end
|
||||
|
||||
factory :unconfirmed_member do
|
||||
confirmed_at nil
|
||||
end
|
||||
|
||||
@@ -40,15 +40,23 @@ describe 'devise/registrations/edit.html.haml', :type => "view" do
|
||||
it 'has a heading' do
|
||||
assert_select "h2", "Profile details"
|
||||
end
|
||||
|
||||
it 'shows show_email checkbox' do
|
||||
assert_select "input[id=member_show_email][type=checkbox]"
|
||||
end
|
||||
|
||||
it "contains a gravatar icon" do
|
||||
assert_select "img", :src => /gravatar\.com\/avatar/
|
||||
end
|
||||
|
||||
it 'contains a link to gravatar.com' do
|
||||
assert_select "a", :href => /gravatar\.com/
|
||||
end
|
||||
|
||||
it 'shows bio field' do
|
||||
assert_select "textarea[id=member_bio]"
|
||||
end
|
||||
|
||||
it 'shows location field' do
|
||||
assert_select "input[id=member_location][type=text]"
|
||||
end
|
||||
|
||||
@@ -12,6 +12,11 @@ describe "members/show" do
|
||||
render
|
||||
end
|
||||
|
||||
it "shows the bio" do
|
||||
assert_select "h2", "Bio"
|
||||
rendered.should contain @member.bio
|
||||
end
|
||||
|
||||
it "shows account creation date" do
|
||||
@time = @member.created_at
|
||||
rendered.should contain "Member since"
|
||||
@@ -27,6 +32,17 @@ describe "members/show" do
|
||||
end
|
||||
end
|
||||
|
||||
context 'no bio' do
|
||||
before(:each) do
|
||||
@member = FactoryGirl.create(:no_bio_member)
|
||||
render
|
||||
end
|
||||
|
||||
it "doesn't show the bio" do
|
||||
rendered.should_not contain "Bio"
|
||||
end
|
||||
end
|
||||
|
||||
context 'twitter' do
|
||||
context "no twitter" do
|
||||
it "doesn't show twitter link" do
|
||||
|
||||
Reference in new issue
Block a user