Merge pull request #967 from sonalkr132/sponsers
Splash page sponsers section style improvement
This commit is contained in:
commit
9e07212cb5
9 changed files with 99 additions and 21 deletions
40
spec/helpers/sponsor_helper_spec.rb
Normal file
40
spec/helpers/sponsor_helper_spec.rb
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe SponsorsHelper, type: :helper do
|
||||
let(:sponsor) { create(:sponsor) }
|
||||
|
||||
describe '#get_logo' do
|
||||
context 'first sponsorship_level' do
|
||||
before do
|
||||
first_sponsorship_level = create(:sponsorship_level, position: 1)
|
||||
sponsor.update_attributes(sponsorship_level: first_sponsorship_level)
|
||||
end
|
||||
|
||||
it 'returns correct url' do
|
||||
expect(get_logo(sponsor)).to match %r{.*(\bfirst/rails.jpg\b)}
|
||||
end
|
||||
end
|
||||
|
||||
context 'second sponsorship_level' do
|
||||
before do
|
||||
second_sponsorship_level = create(:sponsorship_level, position: 2)
|
||||
sponsor.update_attributes(sponsorship_level: second_sponsorship_level)
|
||||
end
|
||||
|
||||
it 'returns correct url' do
|
||||
expect(get_logo(sponsor)).to match %r{.*(\bsecond/rails.jpg\b)}
|
||||
end
|
||||
end
|
||||
|
||||
context 'other sponsorship_level' do
|
||||
before do
|
||||
other_sponsorship_level = create(:sponsorship_level, position: 3)
|
||||
sponsor.update_attributes(sponsorship_level: other_sponsorship_level)
|
||||
end
|
||||
|
||||
it 'returns correct url' do
|
||||
expect(get_logo(sponsor)).to match %r{.*(\bothers/rails.jpg\b)}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -58,7 +58,6 @@ describe 'conference/show.html.haml' do
|
|||
it 'renders sponsors partial' do
|
||||
expect(view).to render_template(partial: 'conference/_sponsors')
|
||||
expect(rendered).to match(/example@example.com/)
|
||||
expect(rendered).to match(/Example sponsor/)
|
||||
expect(rendered).to match(/www.example.com/)
|
||||
expect(rendered).to match(/Lorem Ipsum Dolor/)
|
||||
expect(rendered).to match(/rails.jpg/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue