-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathspec_helper.rb
More file actions
35 lines (28 loc) · 835 Bytes
/
spec_helper.rb
File metadata and controls
35 lines (28 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# encoding: utf-8
$TESTING=true
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
$:.unshift File.expand_path(File.join(File.dirname(__FILE__)))
require 'jammit'
require 'rubygems'
require 'rack'
Dir[File.join(File.dirname(__FILE__), "helpers", "**/*.rb")].each do |f|
require f
end
RSpec.configure do |config|
config.include(Jammit::Spec::Helpers)
# config.include(Warden::Test::Helpers)
# def load_strategies
# Dir[File.join(File.dirname(__FILE__), "helpers", "strategies", "**/*.rb")].each do |f|
# load f
# end
# end
end
def test_html_head(body, tag, keys)
html = Nokogiri::HTML(body)
html.css("head #{tag}").text.should == keys
end
def test_html_head_script(body, str)
html = Nokogiri::HTML(body)
script = html.at_css("script")
script.attributes.first.last.text.should == str
end