font awesome gem updated, validation test added and user show page design updated

This commit is contained in:
AnithaPal 2016-09-15 13:30:58 -04:00
parent a2dd90d355
commit 17aa374b99
7 changed files with 136 additions and 80 deletions

View file

@ -20,16 +20,19 @@ FactoryGirl.define do
sequence(:username) { |n| "username#{n}" }
password 'changeme'
password_confirmation 'changeme'
googleplus { Faker::Internet.url('http://plus.google.com/testosemurl') }
linkedin {Faker::Internet.url('http://linkedin.com/testosemuser')}
website_url { Faker::Internet.url('http://example.com') }
gnu { Faker::Internet.url('http://gnu.io/testosemurl') }
twitter { Faker::Internet.url('http://twitter.com/testosemuser') }
github { Faker::Internet.url('http://github.com/testosemuser') }
gitlab { Faker::Internet.url('http://gitlab.com/testosemuser') }
savannah { Faker::Internet.url('http://savannah.gnu.org/testosemuser') }
diaspora { Faker::Internet.url('http://joindiaspora.com/testosemuser') }
gna { Faker::Internet.url('http://gna.com/testosemuser') }
trait :with_social_media_and_code_info do
googleplus { Faker::Internet.url('plus.google.com') }
linkedin {Faker::Internet.url('linkedin.com')}
website_url{Faker::Internet.url('example.com')}
gnu{Faker::Internet.url('gnu.io')}
twitter{Faker::Internet.url('twitter.com')}
github{Faker::Internet.url('github.com')}
gitlab{Faker::Internet.url('gitlab')}
savannah{Faker::Internet.url('savannah.gnu.org')}
diaspora{Faker::Internet.url('joindiaspora.com')}
gna{Faker::Internet.url('gna.com')}
end
confirmed_at { Time.now }
biography <<-EOS

View file

@ -1,8 +1,7 @@
require 'spec_helper'
feature User do
let!(:user) {create(:user)}
let!(:user) {create(:user, :with_social_media_and_code_info)}
describe 'update user profile' do
scenario 'sucessfully', feature: true do

View file

@ -9,8 +9,7 @@ describe User do
let(:cfp_role) { Role.find_by(name: 'cfp', resource: conference) }
let(:volunteers_coordinator_role) { Role.find_by(name: 'volunteers_coordinator', resource: conference) }
let(:organizer) { create(:user, role_ids: [organizer_role.id]) }
let(:user) { create(:user) }
let!(:user) {create(:user, :with_social_media_and_code_info)}
let(:event1) { create(:event, program: conference.program) }
let(:another_conference) { create(:conference) }
let(:event2) { create(:event, program: another_conference.program) }
@ -48,6 +47,34 @@ describe User do
end
end
describe 'url format validation' do
context 'with valid url' do
it { should allow_value('http://example.com').for(:website_url) }
it { should allow_value('http://linkedin.com').for(:linkedin) }
it { should allow_value('http://googleplus.com').for(:googleplus) }
it { should allow_value('http://gnu.com').for(:gnu) }
it { should allow_value('http://twitter.com').for(:twitter) }
it { should allow_value('http://github.com').for(:github) }
it { should allow_value('http://gitlab.com').for(:gitlab) }
it { should allow_value('http://joindiaspora.com').for(:diaspora) }
it { should allow_value('http://savannah.gnu.org').for(:savannah) }
it { should allow_value('https://linkedin.com').for(:gna) }
end
context 'with invalid url' do
it { should_not allow_value('example').for(:website_url) }
it { should_not allow_value('linkedin').for(:linkedin) }
it { should_not allow_value('googleplus').for(:googleplus) }
it { should_not allow_value('gnu').for(:gnu) }
it { should_not allow_value('@twitter').for(:twitter) }
it { should_not allow_value('@github').for(:github) }
it { should_not allow_value('@gitlab').for(:gitlab) }
it { should_not allow_value('diaspora').for(:diaspora) }
it { should_not allow_value('savannah').for(:savannah) }
it { should_not allow_value('gna').for(:gna) }
end
end
describe 'association' do
it { is_expected.to have_many(:openids) }
it { is_expected.to have_many(:event_users).dependent(:destroy) }