Skip to content

Commit c84a69a

Browse files
committed
Fix specs
1 parent 9feb32b commit c84a69a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/gon.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'action_view'
2+
require 'action_controller'
23
require 'gon/helpers'
34

45
module Gon

spec/gon/gon_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
describe Gon, '#all_variables' do
55
before(:each) do
6-
Gon.stub(:request).and_return(request)
6+
Gon.request_env = {}
77
end
88

99
it 'returns all variables in hash' do
@@ -28,10 +28,10 @@
2828
it 'output as js correct' do
2929
Gon.clear
3030
Gon.int = 1
31-
ActionView::Base.instance_methods.include?('include_gon').should == true
31+
ActionView::Base.instance_methods.map(&:to_s).include?('include_gon').should == true
3232
base = ActionView::Base.new
33-
base.include_gon.should == "<script>window.Gon = {};" +
34-
"Gon.int=1;" +
33+
base.include_gon.should == "<script>window.gon = {};" +
34+
"gon.int=1;" +
3535
"</script>"
3636
end
3737

0 commit comments

Comments
 (0)