middleman-disqus 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -9
- data/Gemfile +5 -8
- data/HISTORY.md +5 -0
- data/README.md +4 -4
- data/Rakefile +3 -12
- data/fixtures/disqus-app/source/{index.html.erb → basic.html.erb} +0 -0
- data/fixtures/disqus-app/source/options1.html.erb +8 -0
- data/fixtures/disqus-app/source/options2.html.erb +5 -0
- data/fixtures/disqus-app/source/per_call_options1.html.erb +1 -0
- data/fixtures/disqus-app/source/per_call_options2.html.erb +5 -0
- data/lib/middleman-disqus/embed.erb +4 -4
- data/lib/middleman-disqus/extension.rb +2 -3
- data/lib/middleman-disqus/version.rb +1 -1
- data/middleman-disqus.gemspec +9 -9
- data/spec/features/basic_spec.rb +21 -0
- data/spec/features/count_spec.rb +17 -0
- data/spec/features/options1_spec.rb +21 -0
- data/spec/features/options2_spec.rb +21 -0
- data/spec/features/per_call_options1_spec.rb +21 -0
- data/spec/features/per_call_options2_spec.rb +22 -0
- data/spec/spec_helper.rb +19 -0
- metadata +23 -11
- data/features/disqus.feature +0 -98
- data/features/support/env.rb +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6956acd8c1e514de5e8dd1ba0d8cde50596b865
|
|
4
|
+
data.tar.gz: 90f84459b92b5dc87e60572098fa9e12819569d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0fea0356be5376ffbc02e2960f48bafea793f2b1eb199f8d66269fc8908c40f3849dbeb03d37a9901aa23806a5158966aa0c85d23a5527e8df604a2758975d78
|
|
7
|
+
data.tar.gz: aa3c7d43d7dfac550296f0b919609427a25dea693653f53d3ff4899678b4ca9ecaa8957f28dcc88c155a3c65a049d8062d2076c91c6423971ef9067bb2eb0d40
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
language: ruby
|
|
2
2
|
rvm:
|
|
3
3
|
- ruby-head
|
|
4
|
-
- 2.
|
|
5
|
-
- 2.1
|
|
6
|
-
- 2.
|
|
7
|
-
- 2.0.0
|
|
8
|
-
- 1.9.3
|
|
9
|
-
- rbx-2
|
|
10
|
-
- rbx-19mode
|
|
4
|
+
- 2.2.4
|
|
5
|
+
- 2.1
|
|
6
|
+
- 2.0
|
|
11
7
|
- jruby-head
|
|
12
|
-
- jruby-19mode
|
|
13
8
|
|
|
14
9
|
matrix:
|
|
15
10
|
allow_failures:
|
|
16
11
|
- rvm: ruby-head
|
|
17
12
|
- rvm: jruby-head
|
|
18
|
-
- rvm: rbx-2
|
data/Gemfile
CHANGED
|
@@ -4,15 +4,12 @@ source 'https://rubygems.org'
|
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
6
|
group :development do
|
|
7
|
-
gem
|
|
8
|
-
gem
|
|
9
|
-
gem
|
|
7
|
+
gem 'rake', '~> 0.9.2'
|
|
8
|
+
gem 'rdoc', '~> 3.9'
|
|
9
|
+
gem 'yard', '~> 0.8.0'
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
group :test do
|
|
13
|
-
gem
|
|
14
|
-
gem
|
|
15
|
-
gem "aruba", "~> 0.5.3"
|
|
13
|
+
gem 'rspec', '~> 3.4'
|
|
14
|
+
gem 'capybara', '~> 2.5'
|
|
16
15
|
end
|
|
17
|
-
|
|
18
|
-
gem "ruby18_source_location", :platforms => :mri_18
|
data/HISTORY.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 1.2.0 (2016-01-06)
|
|
2
|
+
|
|
3
|
+
* Add support for Middleman v4 (please continue to use middleman-disqus 1.1 if you need v3 support).
|
|
4
|
+
* Moved all tests from Cucumber to Capybara / RSpec.
|
|
5
|
+
|
|
1
6
|
## 1.0.0 (2014-08-06)
|
|
2
7
|
|
|
3
8
|
* Add support for Disqus JavaScript configuration variables using per page
|
data/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Middleman Disqus
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/simonrice/middleman-disqus)
|
|
4
|
+
[](http://badge.fury.io/rb/middleman-disqus)
|
|
5
|
+
[](https://gemnasium.com/simonrice/middleman-disqus)
|
|
6
|
+
[](https://codeclimate.com/github/simonrice/middleman-disqus)
|
|
7
7
|
|
|
8
8
|
Middleman-Disqus is a [Middleman](https://github.com/middleman/middleman)
|
|
9
9
|
extension that generates the Disqus embed code, and keeps your config
|
data/Rakefile
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
require '
|
|
2
|
-
Bundler::GemHelper.install_tasks
|
|
1
|
+
require 'rspec/core/rake_task'
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
require 'rake/clean'
|
|
11
|
-
|
|
12
|
-
task :test => ["cucumber"]
|
|
13
|
-
|
|
14
|
-
task :default => :test
|
|
5
|
+
task :default => :spec
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= disqus disqus_url: 'http://example.com/2012/the-best-day-of-my-life.html' %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<div id=
|
|
2
|
-
<script type=
|
|
1
|
+
<div id='disqus_thread'></div>
|
|
2
|
+
<script type='text/javascript'>
|
|
3
3
|
//<![CDATA[
|
|
4
4
|
<% @options.each do |key, value| %>
|
|
5
5
|
<% if value.is_a?(String) %>
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
})();
|
|
17
17
|
//]]>
|
|
18
18
|
</script>
|
|
19
|
-
<noscript>Please enable JavaScript to view the <a href=
|
|
20
|
-
<a href=
|
|
19
|
+
<noscript>Please enable JavaScript to view the <a href='http://disqus.com/?ref_noscript'>comments powered by Disqus.</a></noscript>
|
|
20
|
+
<a href='http://disqus.com' class='dsq-brlink'>comments powered by <span class='logo-disqus'>Disqus</span></a>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'middleman-core'
|
|
2
2
|
|
|
3
3
|
module Middleman
|
|
4
4
|
class DisqusExtension < Extension
|
|
5
|
-
option :shortname, nil,
|
|
5
|
+
option :shortname, nil, 'Your short name for Disqus'
|
|
6
6
|
|
|
7
7
|
def initialize(app, options_hash={}, &block)
|
|
8
8
|
super
|
|
@@ -36,6 +36,5 @@ module Middleman
|
|
|
36
36
|
ERB.new(File.read(file), 0, '>').result(binding)
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
|
-
|
|
40
39
|
end
|
|
41
40
|
end
|
data/middleman-disqus.gemspec
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
$:.push File.expand_path(
|
|
3
|
-
require
|
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
|
3
|
+
require 'middleman-disqus/version'
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |s|
|
|
6
|
-
s.name =
|
|
6
|
+
s.name = 'middleman-disqus'
|
|
7
7
|
s.version = Middleman::Disqus::VERSION
|
|
8
|
-
s.authors = [
|
|
9
|
-
s.email = [
|
|
10
|
-
s.homepage =
|
|
11
|
-
s.license =
|
|
8
|
+
s.authors = ['Simon Rice', 'Luke Antins']
|
|
9
|
+
s.email = ['im@simonrice.com']
|
|
10
|
+
s.homepage = 'http://github.com/simonrice/middleman-disqus'
|
|
11
|
+
s.license = 'MIT'
|
|
12
12
|
s.summary = %q{Quickly integrate Disqus comments into your Middleman site}
|
|
13
13
|
s.description = <<-EOL
|
|
14
14
|
A Middleman extension to integrate Disqus into your site,
|
|
@@ -17,7 +17,7 @@ EOL
|
|
|
17
17
|
|
|
18
18
|
s.files = `git ls-files`.split("\n")
|
|
19
19
|
s.test_files = `git ls-files -- {features,fixtures}/*`.split("\n")
|
|
20
|
-
s.require_paths = [
|
|
20
|
+
s.require_paths = ['lib']
|
|
21
21
|
|
|
22
|
-
s.add_runtime_dependency(
|
|
22
|
+
s.add_runtime_dependency('middleman-core', ['~> 4.0'])
|
|
23
23
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'basic', :type => :feature do
|
|
4
|
+
before do
|
|
5
|
+
visit '/basic.html'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'has the disqus thread element' do
|
|
9
|
+
expect(page).to have_selector '#disqus_thread'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'has the disqus JS element set up' do
|
|
13
|
+
expect(page.html).to include 'disqus.com/embed.js'
|
|
14
|
+
expect(page.html).to include "var disqus_shortname = 'test-name'"
|
|
15
|
+
expect(page.html).to_not include 'var disqus_identifier'
|
|
16
|
+
expect(page.html).to_not include 'var disqus_title'
|
|
17
|
+
expect(page.html).to_not include 'var disqus_url'
|
|
18
|
+
expect(page.html).to_not include 'var disqus_category_id'
|
|
19
|
+
expect(page.html).to_not include 'var disqus_disable_mobile'
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'count', :type => :feature do
|
|
4
|
+
before do
|
|
5
|
+
visit '/count.html'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'has the disqus JS element set up' do
|
|
9
|
+
expect(page.html).to include "var disqus_shortname = 'test-name'"
|
|
10
|
+
expect(page.html).to include 'disqus.com/count.js'
|
|
11
|
+
expect(page.html).to_not include 'var disqus_identifier'
|
|
12
|
+
expect(page.html).to_not include 'var disqus_title'
|
|
13
|
+
expect(page.html).to_not include 'var disqus_url'
|
|
14
|
+
expect(page.html).to_not include 'var disqus_category_id'
|
|
15
|
+
expect(page.html).to_not include 'var disqus_disable_mobile'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'options1', :type => :feature do
|
|
4
|
+
before do
|
|
5
|
+
visit '/options1.html'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'has the disqus thread element' do
|
|
9
|
+
expect(page).to have_selector '#disqus_thread'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'has the disqus JS element set up' do
|
|
13
|
+
expect(page.html).to include 'disqus.com/embed.js'
|
|
14
|
+
expect(page.html).to include "var disqus_shortname = 'test-name'"
|
|
15
|
+
expect(page.html).to include 'var disqus_category_id = 4'
|
|
16
|
+
expect(page.html).to include 'var disqus_disable_mobile = true'
|
|
17
|
+
expect(page.html).to include "var disqus_identifier = '/2012/the-best-day-of-my-life.html'"
|
|
18
|
+
expect(page.html).to include "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html'"
|
|
19
|
+
expect(page.html).to include "var disqus_title = 'The best day of my life'"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'options2', :type => :feature do
|
|
4
|
+
before do
|
|
5
|
+
visit '/options2.html'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'has the disqus thread element' do
|
|
9
|
+
expect(page).to have_selector '#disqus_thread'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'has the disqus JS element set up' do
|
|
13
|
+
expect(page.html).to include 'disqus.com/embed.js'
|
|
14
|
+
expect(page.html).to include "var disqus_shortname = 'test-name'"
|
|
15
|
+
expect(page.html).to include 'var disqus_category_id = 4'
|
|
16
|
+
expect(page.html).to include 'var disqus_disable_mobile = false'
|
|
17
|
+
expect(page.html).to_not include 'var disqus_identifier'
|
|
18
|
+
expect(page.html).to_not include 'var disqus_title'
|
|
19
|
+
expect(page.html).to_not include 'var disqus_url'
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'per_call_options1', :type => :feature do
|
|
4
|
+
before do
|
|
5
|
+
visit '/per_call_options1.html'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'has the disqus thread element' do
|
|
9
|
+
expect(page).to have_selector '#disqus_thread'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'has the disqus JS element set up' do
|
|
13
|
+
expect(page.html).to include 'disqus.com/embed.js'
|
|
14
|
+
expect(page.html).to include "var disqus_shortname = 'test-name'"
|
|
15
|
+
expect(page.html).to include "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html'"
|
|
16
|
+
expect(page.html).to_not include 'var disqus_identifier'
|
|
17
|
+
expect(page.html).to_not include 'var disqus_title'
|
|
18
|
+
expect(page.html).to_not include 'var disqus_category_id'
|
|
19
|
+
expect(page.html).to_not include 'var disqus_disable_mobile'
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe 'per_call_options2', :type => :feature do
|
|
4
|
+
before do
|
|
5
|
+
visit '/per_call_options2.html'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'has the disqus thread element' do
|
|
9
|
+
expect(page).to have_selector '#disqus_thread'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'has the disqus JS element set up' do
|
|
13
|
+
expect(page.html).to include 'disqus.com/embed.js'
|
|
14
|
+
expect(page.html).to include "var disqus_shortname = 'test-name'"
|
|
15
|
+
expect(page.html).to include "var disqus_identifier = '/2012/the-best-day-of-my-life.html'"
|
|
16
|
+
expect(page.html).to include "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html'"
|
|
17
|
+
expect(page.html).to_not include "var disqus_url = 'http://example.com/2015/the-best-day-of-my-life.html'"
|
|
18
|
+
expect(page.html).to_not include 'var disqus_title'
|
|
19
|
+
expect(page.html).to_not include 'var disqus_category_id'
|
|
20
|
+
expect(page.html).to_not include 'var disqus_disable_mobile'
|
|
21
|
+
end
|
|
22
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'rspec'
|
|
2
|
+
require 'capybara/rspec'
|
|
3
|
+
|
|
4
|
+
require 'middleman-core'
|
|
5
|
+
require 'middleman-core/rack'
|
|
6
|
+
|
|
7
|
+
PROJECT_ROOT_PATH = File.dirname(File.dirname(__FILE__))
|
|
8
|
+
require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-disqus')
|
|
9
|
+
|
|
10
|
+
FIXTURE_ROOT_PATH = File.join(PROJECT_ROOT_PATH, 'fixtures', 'disqus-app')
|
|
11
|
+
ENV['MM_ROOT'] = FIXTURE_ROOT_PATH
|
|
12
|
+
|
|
13
|
+
middleman_app = ::Middleman::Application.new
|
|
14
|
+
|
|
15
|
+
Capybara.app = ::Middleman::Rack.new(middleman_app).to_app do
|
|
16
|
+
set :root, FIXTURE_ROOT_PATH
|
|
17
|
+
set :environment, :development
|
|
18
|
+
set :show_exceptions, false
|
|
19
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: middleman-disqus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Simon Rice
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2016-01-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: middleman-core
|
|
@@ -17,14 +17,14 @@ dependencies:
|
|
|
17
17
|
requirements:
|
|
18
18
|
- - "~>"
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: '
|
|
20
|
+
version: '4.0'
|
|
21
21
|
type: :runtime
|
|
22
22
|
prerelease: false
|
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
24
|
requirements:
|
|
25
25
|
- - "~>"
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
|
-
version: '
|
|
27
|
+
version: '4.0'
|
|
28
28
|
description: |
|
|
29
29
|
A Middleman extension to integrate Disqus into your site,
|
|
30
30
|
supporting Disqus configuration variables and comment counts.
|
|
@@ -41,17 +41,26 @@ files:
|
|
|
41
41
|
- LICENSE
|
|
42
42
|
- README.md
|
|
43
43
|
- Rakefile
|
|
44
|
-
- features/disqus.feature
|
|
45
|
-
- features/support/env.rb
|
|
46
44
|
- fixtures/disqus-app/config.rb
|
|
45
|
+
- fixtures/disqus-app/source/basic.html.erb
|
|
47
46
|
- fixtures/disqus-app/source/count.html.erb
|
|
48
|
-
- fixtures/disqus-app/source/
|
|
47
|
+
- fixtures/disqus-app/source/options1.html.erb
|
|
48
|
+
- fixtures/disqus-app/source/options2.html.erb
|
|
49
|
+
- fixtures/disqus-app/source/per_call_options1.html.erb
|
|
50
|
+
- fixtures/disqus-app/source/per_call_options2.html.erb
|
|
49
51
|
- lib/middleman-disqus.rb
|
|
50
52
|
- lib/middleman-disqus/count.erb
|
|
51
53
|
- lib/middleman-disqus/embed.erb
|
|
52
54
|
- lib/middleman-disqus/extension.rb
|
|
53
55
|
- lib/middleman-disqus/version.rb
|
|
54
56
|
- middleman-disqus.gemspec
|
|
57
|
+
- spec/features/basic_spec.rb
|
|
58
|
+
- spec/features/count_spec.rb
|
|
59
|
+
- spec/features/options1_spec.rb
|
|
60
|
+
- spec/features/options2_spec.rb
|
|
61
|
+
- spec/features/per_call_options1_spec.rb
|
|
62
|
+
- spec/features/per_call_options2_spec.rb
|
|
63
|
+
- spec/spec_helper.rb
|
|
55
64
|
homepage: http://github.com/simonrice/middleman-disqus
|
|
56
65
|
licenses:
|
|
57
66
|
- MIT
|
|
@@ -72,13 +81,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
72
81
|
version: '0'
|
|
73
82
|
requirements: []
|
|
74
83
|
rubyforge_project:
|
|
75
|
-
rubygems_version: 2.4.5
|
|
84
|
+
rubygems_version: 2.4.5.1
|
|
76
85
|
signing_key:
|
|
77
86
|
specification_version: 4
|
|
78
87
|
summary: Quickly integrate Disqus comments into your Middleman site
|
|
79
88
|
test_files:
|
|
80
|
-
- features/disqus.feature
|
|
81
|
-
- features/support/env.rb
|
|
82
89
|
- fixtures/disqus-app/config.rb
|
|
90
|
+
- fixtures/disqus-app/source/basic.html.erb
|
|
83
91
|
- fixtures/disqus-app/source/count.html.erb
|
|
84
|
-
- fixtures/disqus-app/source/
|
|
92
|
+
- fixtures/disqus-app/source/options1.html.erb
|
|
93
|
+
- fixtures/disqus-app/source/options2.html.erb
|
|
94
|
+
- fixtures/disqus-app/source/per_call_options1.html.erb
|
|
95
|
+
- fixtures/disqus-app/source/per_call_options2.html.erb
|
|
96
|
+
has_rdoc:
|
data/features/disqus.feature
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
Feature: Disqus Integration
|
|
2
|
-
|
|
3
|
-
Scenario: Disqus config var `shotname` is not set
|
|
4
|
-
Given a fixture app "disqus-app"
|
|
5
|
-
And a file named "config.rb" with:
|
|
6
|
-
"""
|
|
7
|
-
activate :disqus do |d|
|
|
8
|
-
d.shortname = nil
|
|
9
|
-
end
|
|
10
|
-
"""
|
|
11
|
-
And the Server is running
|
|
12
|
-
When I go to "/"
|
|
13
|
-
Then I should see "0" lines
|
|
14
|
-
When I go to "/count.html"
|
|
15
|
-
Then I should see "0" lines
|
|
16
|
-
|
|
17
|
-
Scenario: Basic usage, Disqus javascript is included when `shotname` is set
|
|
18
|
-
Given a successfully built app at "disqus-app"
|
|
19
|
-
When I cd to "build"
|
|
20
|
-
Then the following files should exist:
|
|
21
|
-
| index.html |
|
|
22
|
-
| count.html |
|
|
23
|
-
And the file "index.html" should contain 'div id="disqus_thread"'
|
|
24
|
-
And the file "index.html" should contain "var disqus_shortname = 'test-name';"
|
|
25
|
-
And the file "index.html" should contain 'disqus.com/embed.js'
|
|
26
|
-
And the file "count.html" should contain "var disqus_shortname = 'test-name';"
|
|
27
|
-
And the file "count.html" should contain 'disqus.com/count.js'
|
|
28
|
-
|
|
29
|
-
Scenario: Per page Disqus variables
|
|
30
|
-
Given a fixture app "disqus-app"
|
|
31
|
-
And a file named "source/options.html.erb" with:
|
|
32
|
-
"""
|
|
33
|
-
---
|
|
34
|
-
disqus_identifier: /2012/the-best-day-of-my-life.html
|
|
35
|
-
disqus_title: The best day of my life
|
|
36
|
-
disqus_url: http://example.com/2012/the-best-day-of-my-life.html
|
|
37
|
-
disqus_category_id: 4
|
|
38
|
-
disqus_disable_mobile: true
|
|
39
|
-
---
|
|
40
|
-
<%= disqus %>
|
|
41
|
-
"""
|
|
42
|
-
And a successfully built app at "disqus-app"
|
|
43
|
-
When I cd to "build"
|
|
44
|
-
Then the following files should exist:
|
|
45
|
-
| options.html |
|
|
46
|
-
And the file "options.html" should contain "var disqus_identifier = '/2012/the-best-day-of-my-life.html';"
|
|
47
|
-
And the file "options.html" should contain "var disqus_title = 'The best day of my life';"
|
|
48
|
-
And the file "options.html" should contain "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html';"
|
|
49
|
-
And the file "options.html" should contain "var disqus_category_id = 4;"
|
|
50
|
-
And the file "options.html" should contain "var disqus_disable_mobile = true;"
|
|
51
|
-
|
|
52
|
-
Scenario: Only set a couple of per page Disqus variables
|
|
53
|
-
Given a fixture app "disqus-app"
|
|
54
|
-
And a file named "source/options.html.erb" with:
|
|
55
|
-
"""
|
|
56
|
-
---
|
|
57
|
-
disqus_category_id: 4
|
|
58
|
-
disqus_disable_mobile: false
|
|
59
|
-
---
|
|
60
|
-
<%= disqus %>
|
|
61
|
-
"""
|
|
62
|
-
And a successfully built app at "disqus-app"
|
|
63
|
-
When I cd to "build"
|
|
64
|
-
Then the following files should exist:
|
|
65
|
-
| options.html |
|
|
66
|
-
And the file "options.html" should not contain "var disqus_identifier"
|
|
67
|
-
And the file "options.html" should not contain "var disqus_title"
|
|
68
|
-
And the file "options.html" should not contain "var disqus_url"
|
|
69
|
-
And the file "options.html" should contain "var disqus_category_id = 4;"
|
|
70
|
-
And the file "options.html" should contain "var disqus_disable_mobile = false;"
|
|
71
|
-
|
|
72
|
-
Scenario: Per call Disqus variables
|
|
73
|
-
Given a fixture app "disqus-app"
|
|
74
|
-
And a file named "source/per-call-options.html.erb" with:
|
|
75
|
-
"""
|
|
76
|
-
<%= disqus disqus_url: "http://example.com/2012/the-best-day-of-my-life.html" %>
|
|
77
|
-
"""
|
|
78
|
-
And a successfully built app at "disqus-app"
|
|
79
|
-
When I cd to "build"
|
|
80
|
-
Then the following files should exist:
|
|
81
|
-
| per-call-options.html |
|
|
82
|
-
And the file "per-call-options.html" should contain "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html';"
|
|
83
|
-
|
|
84
|
-
Scenario: Per call Disqus variables overriding page variables
|
|
85
|
-
Given a fixture app "disqus-app"
|
|
86
|
-
And a file named "source/per-call-options.html.erb" with:
|
|
87
|
-
"""
|
|
88
|
-
---
|
|
89
|
-
disqus_identifier: /2012/the-best-day-of-my-life.html
|
|
90
|
-
disqus_url: http://example.com/2012/better-day-of-my-life.html
|
|
91
|
-
---
|
|
92
|
-
<%= disqus disqus_url: "http://example.com/2012/the-best-day-of-my-life.html" %>
|
|
93
|
-
"""
|
|
94
|
-
And a successfully built app at "disqus-app"
|
|
95
|
-
When I cd to "build"
|
|
96
|
-
Then the following files should exist:
|
|
97
|
-
| per-call-options.html |
|
|
98
|
-
And the file "per-call-options.html" should contain "var disqus_url = 'http://example.com/2012/the-best-day-of-my-life.html';"
|