page_right 0.4.1 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/{LICENSE.txt → MIT-LICENSE} +0 -0
- data/README.md +5 -3
- data/lib/page_right/{css_checker.rb → css_helper.rb} +5 -5
- data/lib/page_right/{image_checker.rb → image_helper.rb} +3 -3
- data/lib/page_right/railtie.rb +12 -0
- data/lib/page_right/{text_checker.rb → text_helper.rb} +5 -5
- data/lib/page_right/version.rb +1 -1
- data/lib/page_right.rb +2 -4
- metadata +23 -16
- data/.gitignore +0 -14
- data/CHANGES.md +0 -9
- data/Gemfile +0 -4
- data/Rakefile +0 -13
- data/page_right.gemspec +0 -26
- data/test/test_helper.rb +0 -3
- data/test/test_setup_test.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98c311ccc03833a13ca63769cc1ffbe45e04f74f
|
4
|
+
data.tar.gz: e8eaf82d0379b75d82c5176c391d2db04b418e31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36ae33e70699608da447c8e674913b5a13704f5d879de3e6564d22731e5bff8ba5224cccce8f7142edc1272b682fb05a541fa90198d323f86927649fbd5cbcc3
|
7
|
+
data.tar.gz: ccf8e7526da997661809232b93111404380ba08100dd65fad7ecd7be86468d1c876e62f42cf7fd894130d936f36399c1e815bfe195b0bc2a01fec39b0dab8c9b
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
0.5
|
2
|
+
--------------------
|
3
|
+
|
4
|
+
- Made the component libraies individually loadable via the test_help.rb file.
|
5
|
+
|
6
|
+
0.4.1
|
7
|
+
--------------------
|
8
|
+
|
9
|
+
- Minor fix to README.md page.
|
10
|
+
|
11
|
+
0.4
|
12
|
+
--------------------
|
13
|
+
|
14
|
+
- Migrated original code from the old page-right gem to this new page_right gem and separated out the methods into sub files.
|
data/{LICENSE.txt → MIT-LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## PageRight Gem - Checks the content of your rendered web pages. `Currently under development !!`
|
2
2
|
|
3
|
-
Version 0.
|
3
|
+
Version 0.5 201st November 2014
|
4
4
|
|
5
5
|
A very simple gem that contains a few helper/wrapper methods utilising Capybara to aid testing the contents of a rendered web page when writing integration tests.
|
6
6
|
|
@@ -16,10 +16,12 @@ Include it in your Gemfile.
|
|
16
16
|
gem 'page_right'
|
17
17
|
```
|
18
18
|
|
19
|
-
Then require
|
19
|
+
Then require one or more of the components your want to use in your `test_helper.rb` file. Currently the gem performs checks on text, css and images in your web pages.
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
require 'page_right'
|
22
|
+
require 'page_right/text_checks'
|
23
|
+
require 'page_right/css_checks'
|
24
|
+
require 'page_right/image_checks'
|
23
25
|
```
|
24
26
|
|
25
27
|
### Method Descriptions:
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
1
|
+
module PageRight
|
2
|
+
module CssHelper
|
3
|
+
# Check that a css element is on the page, set flag to check that it isn't
|
4
4
|
def css_in_page(css, flag=true)
|
5
5
|
if flag
|
6
6
|
assert page.has_css?("#{css}"), "Error: #{css} not found on page !"
|
@@ -19,5 +19,5 @@ module ActiveSupport
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
23
|
-
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module PageRight
|
2
|
+
module ImageHelper
|
3
3
|
# Check that 'count' number of 'image's is in a 'section' of css, set flag to check that it/they isn't/arn't
|
4
4
|
def image_in_section(section, image, count, flag=true)
|
5
5
|
if flag
|
@@ -8,5 +8,5 @@ module ActiveSupport
|
|
8
8
|
assert !page.has_selector?(:css,"#{section} img[src$='/assets/#{image}']", count: count), "Error: #{count} #{image}(s) found in #{section} !"
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
11
|
+
end
|
12
12
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'page_right/css_helper'
|
3
|
+
require 'page_right/text_helper'
|
4
|
+
require 'page_right/image_helper'
|
5
|
+
|
6
|
+
class Railtie < Rails::Railtie
|
7
|
+
initializer "page_right.add_helpers" do
|
8
|
+
ActiveSupport::TestCase.send(:include, PageRight::TextHelper)
|
9
|
+
ActiveSupport::TestCase.send(:include, PageRight::ImageHelper)
|
10
|
+
ActiveSupport::TestCase.send(:include, PageRight::CssHelper)
|
11
|
+
end
|
12
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
1
|
+
module PageRight
|
2
|
+
module TextHelper
|
3
|
+
# Check that the text 'content' is on the page, set flag to check that it isn't
|
4
4
|
def text_in_page(content, flag=true)
|
5
5
|
if flag
|
6
6
|
assert page.has_content?("#{content}"), "Error: #{content} not found page !"
|
@@ -19,5 +19,5 @@ module ActiveSupport
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
23
|
-
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/page_right/version.rb
CHANGED
data/lib/page_right.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_right
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Collier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capybara
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.4'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,20 +102,15 @@ executables: []
|
|
88
102
|
extensions: []
|
89
103
|
extra_rdoc_files: []
|
90
104
|
files:
|
91
|
-
-
|
92
|
-
-
|
93
|
-
- Gemfile
|
94
|
-
- LICENSE.txt
|
105
|
+
- CHANGELOG.md
|
106
|
+
- MIT-LICENSE
|
95
107
|
- README.md
|
96
|
-
- Rakefile
|
97
108
|
- lib/page_right.rb
|
98
|
-
- lib/page_right/
|
99
|
-
- lib/page_right/
|
100
|
-
- lib/page_right/
|
109
|
+
- lib/page_right/css_helper.rb
|
110
|
+
- lib/page_right/image_helper.rb
|
111
|
+
- lib/page_right/railtie.rb
|
112
|
+
- lib/page_right/text_helper.rb
|
101
113
|
- lib/page_right/version.rb
|
102
|
-
- page_right.gemspec
|
103
|
-
- test/test_helper.rb
|
104
|
-
- test/test_setup_test.rb
|
105
114
|
homepage: https://github.com/lardelbow/page_right
|
106
115
|
licenses:
|
107
116
|
- MIT
|
@@ -126,7 +135,5 @@ rubygems_version: 2.2.2
|
|
126
135
|
signing_key:
|
127
136
|
specification_version: 4
|
128
137
|
summary: A simple gem that helps you with testing the contents of a rendered web page
|
129
|
-
test_files:
|
130
|
-
- test/test_helper.rb
|
131
|
-
- test/test_setup_test.rb
|
138
|
+
test_files: []
|
132
139
|
has_rdoc:
|
data/.gitignore
DELETED
data/CHANGES.md
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/page_right.gemspec
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'page_right/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "page_right"
|
8
|
-
spec.version = PageRight::VERSION
|
9
|
-
spec.authors = ["Dave Collier"]
|
10
|
-
spec.email = ["lardelbow@gmail.com"]
|
11
|
-
spec.summary = 'A simple gem that helps you with testing the contents of a rendered web page'
|
12
|
-
spec.description = 'A simple gem that helps you with testing the contents of a rendered web page. Currently in development.'
|
13
|
-
spec.homepage = "https://github.com/lardelbow/page_right"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
-
spec.add_development_dependency "minitest", "~> 5.4"
|
24
|
-
spec.add_development_dependency "pry", "~> 0.10"
|
25
|
-
spec.add_development_dependency "pry-doc", "~> 0.6"
|
26
|
-
end
|
data/test/test_helper.rb
DELETED