Skip to content

Commit

Permalink
Added per call option fixtures, completing the version 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRice committed Jan 6, 2016
1 parent 26ad26c commit f4acd10
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
disqus_identifier: /2012/the-best-day-of-my-life.html
disqus_url: http://example.com/2012/better-day-of-my-life.html
disqus_url: http://example.com/2015/better-day-of-my-life.html
---
<%= disqus disqus_url: 'http://example.com/2012/the-best-day-of-my-life.html' %>
21 changes: 21 additions & 0 deletions spec/features/per_call_options1_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'spec_helper'

describe 'per_call_options1', :type => :feature do
before do
visit '/per_call_options1.html'
end

it 'has the disqus thread element' do
expect(page).to have_selector '#disqus_thread'
end

it 'has the disqus JS element set up' do
expect(page.html).to include 'disqus.com/embed.js'
expect(page.html).to include "var disqus_shortname = 'test-name'"
expect(page.html).to include "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html'"
expect(page.html).to_not include 'var disqus_identifier'
expect(page.html).to_not include 'var disqus_title'
expect(page.html).to_not include 'var disqus_category_id'
expect(page.html).to_not include 'var disqus_disable_mobile'
end
end
22 changes: 22 additions & 0 deletions spec/features/per_call_options2_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'spec_helper'

describe 'per_call_options2', :type => :feature do
before do
visit '/per_call_options2.html'
end

it 'has the disqus thread element' do
expect(page).to have_selector '#disqus_thread'
end

it 'has the disqus JS element set up' do
expect(page.html).to include 'disqus.com/embed.js'
expect(page.html).to include "var disqus_shortname = 'test-name'"
expect(page.html).to include "var disqus_identifier = '/2012/the-best-day-of-my-life.html'"
expect(page.html).to include "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html'"
expect(page.html).to_not include "var disqus_url = 'http://example.com/2015/the-best-day-of-my-life.html'"
expect(page.html).to_not include 'var disqus_title'
expect(page.html).to_not include 'var disqus_category_id'
expect(page.html).to_not include 'var disqus_disable_mobile'
end
end

0 comments on commit f4acd10

Please sign in to comment.