Class: AnyClass

Inherits:
Object
  • Object
show all
Includes:
RenderAnywhere
Defined in:
lib/simple_javascript_testing.rb

Defined Under Namespace

Classes: RenderingController

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.prefixObject

Returns the value of attribute prefix.



9
10
11
# File 'lib/simple_javascript_testing.rb', line 9

def prefix
  @prefix
end

Class Method Details

.test_directoryObject



11
12
13
# File 'lib/simple_javascript_testing.rb', line 11

def test_directory
  @test_directory || "test"
end

.test_directory=(dir) ⇒ Object



15
16
17
# File 'lib/simple_javascript_testing.rb', line 15

def test_directory=(dir)
  @test_directory = dir
end

Instance Method Details

#build_html(template) ⇒ Object



20
21
22
23
24
# File 'lib/simple_javascript_testing.rb', line 20

def build_html(template)
  html = render :template => template,
                :layout => 'application'
  html
end

#include_helper(helper_name) ⇒ Object

Include an additional helper If being used in a rake task, you may need to require the file(s) Ex: require Rails.root.join(‘app’, ‘helpers’, ‘blog_pages_helper’)



28
29
30
# File 'lib/simple_javascript_testing.rb', line 28

def include_helper(helper_name)
  set_render_anywhere_helpers(helper_name)
end

#set_instance_variable_to(var, value) ⇒ Object

Apply an instance variable to the controller If you need to use instance variables instead of locals, just call this method as many times as you need.



34
35
36
# File 'lib/simple_javascript_testing.rb', line 34

def set_instance_variable_to(var, value)
  set_instance_variable(var, value)
end