Module: BotAway::TestCase
- Defined in:
- lib/bot-away/test_case.rb
Defined Under Namespace
Modules: ControllerTestCase, InstanceTagTestCase, Matchers
Classes: MockObject
Instance Method Summary
collapse
Instance Method Details
#builder ⇒ Object
7
8
9
|
# File 'lib/bot-away/test_case.rb', line 7
def builder
@builder ||= ActionView::Base.default_form_builder.new(object_name, mock_object, view, {}, proc {})
end
|
#disable_forgery_protection ⇒ Object
20
21
22
23
|
# File 'lib/bot-away/test_case.rb', line 20
def disable_forgery_protection
Rails.application.config.allow_forgery_protection = false
ActionController::Base.allow_forgery_protection = false
end
|
#dump ⇒ Object
53
54
55
56
57
|
# File 'lib/bot-away/test_case.rb', line 53
def dump
result = yield
puts result if ENV['DUMP']
result
end
|
#enable_forgery_protection ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/bot-away/test_case.rb', line 11
def enable_forgery_protection
Rails.application.config.allow_forgery_protection = true
ActionController::Base.allow_forgery_protection = true
end
|
#method_name ⇒ Object
41
42
43
|
# File 'lib/bot-away/test_case.rb', line 41
def method_name
"method_name"
end
|
#mock_object ⇒ Object
25
26
27
|
# File 'lib/bot-away/test_case.rb', line 25
def mock_object
@mock_object ||= MockObject.new
end
|
#obfuscated_id ⇒ Object
29
30
31
|
# File 'lib/bot-away/test_case.rb', line 29
def obfuscated_id
"f51a02a636f507f1bd64722451b71297"
end
|
#obfuscated_name ⇒ Object
33
34
35
|
# File 'lib/bot-away/test_case.rb', line 33
def obfuscated_name
"cd538a9170613d6dedbcc54a0aa24881"
end
|
#object_name ⇒ Object
37
38
39
|
# File 'lib/bot-away/test_case.rb', line 37
def object_name
"object_name"
end
|
#tag_id ⇒ Object
45
46
47
|
# File 'lib/bot-away/test_case.rb', line 45
def tag_id
"#{object_name}_#{method_name}"
end
|
#tag_name ⇒ Object
49
50
51
|
# File 'lib/bot-away/test_case.rb', line 49
def tag_name
"#{object_name}[#{method_name}]"
end
|