solidstats 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -63
- data/README.md +27 -0
- data/Rakefile +3 -3
- data/app/assets/javascripts/solidstats/dashboard.js +0 -46
- data/app/assets/stylesheets/solidstats/dashboard.css +48 -0
- data/app/controllers/solidstats/dashboard_controller.rb +73 -61
- data/app/controllers/solidstats/logs_controller.rb +72 -0
- data/app/controllers/solidstats/performance_controller.rb +25 -0
- data/app/controllers/solidstats/productivity_controller.rb +39 -0
- data/app/controllers/solidstats/quality_controller.rb +152 -0
- data/app/controllers/solidstats/securities_controller.rb +30 -0
- data/app/helpers/solidstats/application_helper.rb +124 -11
- data/app/helpers/solidstats/performance_helper.rb +87 -0
- data/app/helpers/solidstats/productivity_helper.rb +38 -0
- data/app/services/solidstats/bundler_audit_service.rb +206 -0
- data/app/services/solidstats/coverage_compass_service.rb +335 -0
- data/app/services/solidstats/load_lens_service.rb +474 -0
- data/app/services/solidstats/log_size_monitor_service.rb +197 -66
- data/app/services/solidstats/my_todo_service.rb +242 -0
- data/app/services/solidstats/style_patrol_service.rb +319 -0
- data/app/views/layouts/solidstats/application.html.erb +8 -2
- data/app/views/layouts/solidstats/dashboard.html.erb +84 -0
- data/app/views/solidstats/dashboard/dashboard.html.erb +39 -0
- data/app/views/solidstats/logs/logs_size.html.erb +409 -0
- data/app/views/solidstats/performance/load_lens.html.erb +158 -0
- data/app/views/solidstats/productivity/_todo_list.html.erb +49 -0
- data/app/views/solidstats/productivity/my_todos.html.erb +84 -0
- data/app/views/solidstats/quality/coverage_compass.html.erb +420 -0
- data/app/views/solidstats/quality/style_patrol.html.erb +463 -0
- data/app/views/solidstats/securities/bundler_audit.html.erb +345 -0
- data/app/views/solidstats/shared/_dashboard_card.html.erb +160 -0
- data/app/views/solidstats/shared/_quick_actions.html.erb +26 -0
- data/config/routes.rb +31 -6
- data/lib/generators/solidstats/clean/clean_generator.rb +24 -0
- data/lib/generators/solidstats/clean/templates/README +8 -0
- data/lib/generators/solidstats/install/install_generator.rb +51 -10
- data/lib/generators/solidstats/install/templates/README +7 -0
- data/lib/solidstats/engine.rb +6 -71
- data/lib/solidstats/version.rb +1 -1
- data/lib/solidstats.rb +19 -303
- data/lib/tasks/solidstats.rake +67 -0
- data/lib/tasks/solidstats_performance.rake +61 -0
- data/lib/tasks/solidstats_tasks.rake +16 -4
- metadata +33 -95
- data/app/assets/javascripts/solidstats/gem_metadata.js +0 -554
- data/app/assets/stylesheets/solidstats/components/action_button.css +0 -99
- data/app/assets/stylesheets/solidstats/components/dashboard.css +0 -151
- data/app/assets/stylesheets/solidstats/components/dashboard_header.css +0 -93
- data/app/assets/stylesheets/solidstats/components/dashboard_layout.css +0 -97
- data/app/assets/stylesheets/solidstats/components/gem_metadata.css +0 -1403
- data/app/assets/stylesheets/solidstats/components/navigation.css +0 -80
- data/app/assets/stylesheets/solidstats/components/quick_navigation.css +0 -54
- data/app/assets/stylesheets/solidstats/components/security.css +0 -332
- data/app/assets/stylesheets/solidstats/components/status_badge.css +0 -58
- data/app/assets/stylesheets/solidstats/components/summary_card.css +0 -66
- data/app/assets/stylesheets/solidstats/components/tab_navigation.css +0 -95
- data/app/components/solidstats/base_component.rb +0 -88
- data/app/components/solidstats/code_quality/code_quality_section_component.html.erb +0 -0
- data/app/components/solidstats/code_quality/code_quality_section_component.rb +0 -0
- data/app/components/solidstats/code_quality/section_component.html.erb +0 -45
- data/app/components/solidstats/code_quality/section_component.rb +0 -34
- data/app/components/solidstats/dashboard_header_component.html.erb +0 -39
- data/app/components/solidstats/dashboard_header_component.rb +0 -33
- data/app/components/solidstats/previews/action_button_component_preview/button_vs_link.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview/sizes.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview/variants.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview/with_icons.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview.rb +0 -64
- data/app/components/solidstats/previews/navigation_component_preview.rb +0 -74
- data/app/components/solidstats/previews/stats_overview_component_preview.rb +0 -100
- data/app/components/solidstats/previews/status_badge_component_preview/sizes.html.erb +0 -6
- data/app/components/solidstats/previews/status_badge_component_preview/statuses.html.erb +0 -6
- data/app/components/solidstats/previews/status_badge_component_preview/with_icons.html.erb +0 -6
- data/app/components/solidstats/previews/status_badge_component_preview.rb +0 -49
- data/app/components/solidstats/previews/summary_card_component_preview/clickable.html.erb +0 -9
- data/app/components/solidstats/previews/summary_card_component_preview/dashboard_layout.html.erb +0 -9
- data/app/components/solidstats/previews/summary_card_component_preview/statuses.html.erb +0 -6
- data/app/components/solidstats/previews/summary_card_component_preview/value_formats.html.erb +0 -6
- data/app/components/solidstats/previews/summary_card_component_preview.rb +0 -67
- data/app/components/solidstats/quick_navigation_component.html.erb +0 -8
- data/app/components/solidstats/quick_navigation_component.rb +0 -21
- data/app/components/solidstats/security/gem_impact_analysis_component.html.erb +0 -44
- data/app/components/solidstats/security/gem_impact_analysis_component.rb +0 -45
- data/app/components/solidstats/security/overview_component.html.erb +0 -21
- data/app/components/solidstats/security/overview_component.rb +0 -104
- data/app/components/solidstats/security/section_component.html.erb +0 -26
- data/app/components/solidstats/security/section_component.rb +0 -52
- data/app/components/solidstats/security/timeline_component.html.erb +0 -39
- data/app/components/solidstats/security/timeline_component.rb +0 -43
- data/app/components/solidstats/tasks_section_component.html.erb +0 -17
- data/app/components/solidstats/tasks_section_component.rb +0 -22
- data/app/components/solidstats/ui/action_button_component.html.erb +0 -6
- data/app/components/solidstats/ui/action_button_component.rb +0 -71
- data/app/components/solidstats/ui/dashboard_layout_component.html.erb +0 -19
- data/app/components/solidstats/ui/dashboard_layout_component.rb +0 -85
- data/app/components/solidstats/ui/navigation_component.html.erb +0 -34
- data/app/components/solidstats/ui/navigation_component.rb +0 -72
- data/app/components/solidstats/ui/stats_overview_component.html.erb +0 -14
- data/app/components/solidstats/ui/stats_overview_component.rb +0 -78
- data/app/components/solidstats/ui/status_badge_component.html.erb +0 -6
- data/app/components/solidstats/ui/status_badge_component.rb +0 -42
- data/app/components/solidstats/ui/summary_card_component.html.erb +0 -12
- data/app/components/solidstats/ui/summary_card_component.rb +0 -63
- data/app/components/solidstats/ui/tab_navigation_component.html.erb +0 -22
- data/app/components/solidstats/ui/tab_navigation_component.rb +0 -79
- data/app/services/solidstats/audit_service.rb +0 -56
- data/app/services/solidstats/data_collector_service.rb +0 -83
- data/app/services/solidstats/gem_metadata/fetcher_service.rb +0 -136
- data/app/services/solidstats/todo_service.rb +0 -114
- data/app/views/solidstats/dashboard/_log_monitor.html.erb +0 -759
- data/app/views/solidstats/dashboard/_todos.html.erb +0 -151
- data/app/views/solidstats/dashboard/audit/_additional_styles.css +0 -22
- data/app/views/solidstats/dashboard/audit/_audit_badge.html.erb +0 -5
- data/app/views/solidstats/dashboard/audit/_audit_details.html.erb +0 -495
- data/app/views/solidstats/dashboard/audit/_audit_summary.html.erb +0 -26
- data/app/views/solidstats/dashboard/audit/_no_vulnerabilities.html.erb +0 -3
- data/app/views/solidstats/dashboard/audit/_security_audit.html.erb +0 -14
- data/app/views/solidstats/dashboard/audit/_vulnerabilities_table.html.erb +0 -1120
- data/app/views/solidstats/dashboard/audit/_vulnerability_details.html.erb +0 -63
- data/app/views/solidstats/dashboard/index.html.erb +0 -81
- data/app/views/solidstats/gem_metadata/_panel.html.erb +0 -419
- data/lib/generators/solidstats/feature/feature_generator.rb +0 -170
- data/lib/generators/solidstats/feature/templates/component.html.erb +0 -84
- data/lib/generators/solidstats/feature/templates/component.rb.erb +0 -103
- data/lib/generators/solidstats/feature/templates/component.scss +0 -243
- data/lib/generators/solidstats/feature/templates/component_test.rb.erb +0 -183
- data/lib/generators/solidstats/feature/templates/controller.rb.erb +0 -44
- data/lib/generators/solidstats/feature/templates/controller_test.rb.erb +0 -111
- data/lib/generators/solidstats/feature/templates/detail_view.html.erb +0 -755
- data/lib/generators/solidstats/feature/templates/preview.rb.erb +0 -107
- data/lib/generators/solidstats/feature/templates/service.rb.erb +0 -132
- data/lib/generators/solidstats/feature/templates/service_test.rb.erb +0 -109
- data/lib/generators/solidstats/install_generator.rb +0 -109
- data/lib/tasks/solidstats_install.rake +0 -133
@@ -1,183 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
module Solidstats
|
4
|
-
class <%= class_name %>HelperTest < ActionView::TestCase
|
5
|
-
include Solidstats::<%= class_name %>Helper
|
6
|
-
|
7
|
-
def setup
|
8
|
-
@sample_data = {
|
9
|
-
value: 42,
|
10
|
-
count: 8,
|
11
|
-
status: :good,
|
12
|
-
last_updated: 30.minutes.ago,
|
13
|
-
items: [
|
14
|
-
{
|
15
|
-
name: "Test Item 1",
|
16
|
-
value: 15,
|
17
|
-
category: "important",
|
18
|
-
description: "Test description"
|
19
|
-
},
|
20
|
-
{
|
21
|
-
name: "Test Item 2",
|
22
|
-
value: 8,
|
23
|
-
category: "normal"
|
24
|
-
}
|
25
|
-
]
|
26
|
-
}
|
27
|
-
end
|
28
|
-
|
29
|
-
test "returns correct status class" do
|
30
|
-
assert_equal "status-good", <%= file_name %>_status_class(@sample_data)
|
31
|
-
|
32
|
-
warning_data = @sample_data.merge(status: :warning)
|
33
|
-
assert_equal "status-warning", <%= file_name %>_status_class(warning_data)
|
34
|
-
|
35
|
-
critical_data = @sample_data.merge(status: :critical)
|
36
|
-
assert_equal "status-critical", <%= file_name %>_status_class(critical_data)
|
37
|
-
end
|
38
|
-
|
39
|
-
test "returns correct status icon" do
|
40
|
-
assert_equal "✅", <%= file_name %>_status_icon(@sample_data)
|
41
|
-
|
42
|
-
warning_data = @sample_data.merge(status: :warning)
|
43
|
-
assert_equal "⚠️", <%= file_name %>_status_icon(warning_data)
|
44
|
-
|
45
|
-
critical_data = @sample_data.merge(status: :critical)
|
46
|
-
assert_equal "❌", <%= file_name %>_status_icon(critical_data)
|
47
|
-
end
|
48
|
-
|
49
|
-
test "returns correct status text" do
|
50
|
-
assert_equal "Good", <%= file_name %>_status_text(@sample_data)
|
51
|
-
|
52
|
-
critical_data = @sample_data.merge(status: :critical)
|
53
|
-
assert_equal "Critical", <%= file_name %>_status_text(critical_data)
|
54
|
-
end
|
55
|
-
|
56
|
-
test "displays value correctly" do
|
57
|
-
assert_equal "42", <%= file_name %>_value_display(@sample_data)
|
58
|
-
|
59
|
-
large_value_data = @sample_data.merge(value: 1234567)
|
60
|
-
assert_equal "1,234,567", <%= file_name %>_value_display(large_value_data)
|
61
|
-
|
62
|
-
string_value_data = @sample_data.merge(value: "Custom Value")
|
63
|
-
assert_equal "Custom Value", <%= file_name %>_value_display(string_value_data)
|
64
|
-
end
|
65
|
-
|
66
|
-
test "returns last updated time" do
|
67
|
-
result = <%= file_name %>_last_updated(@sample_data)
|
68
|
-
assert_includes result, "ago"
|
69
|
-
|
70
|
-
no_update_data = @sample_data.except(:last_updated)
|
71
|
-
assert_equal "Never", <%= file_name %>_last_updated(no_update_data)
|
72
|
-
end
|
73
|
-
|
74
|
-
test "detects items presence" do
|
75
|
-
assert <%= file_name %>_has_items?(@sample_data)
|
76
|
-
|
77
|
-
no_items_data = @sample_data.merge(items: [])
|
78
|
-
refute <%= file_name %>_has_items?(no_items_data)
|
79
|
-
|
80
|
-
nil_items_data = @sample_data.merge(items: nil)
|
81
|
-
refute <%= file_name %>_has_items?(nil_items_data)
|
82
|
-
end
|
83
|
-
|
84
|
-
test "counts items correctly" do
|
85
|
-
assert_equal 2, <%= file_name %>_item_count(@sample_data)
|
86
|
-
|
87
|
-
no_items_data = @sample_data.merge(items: [])
|
88
|
-
assert_equal 0, <%= file_name %>_item_count(no_items_data)
|
89
|
-
|
90
|
-
nil_items_data = @sample_data.merge(items: nil)
|
91
|
-
assert_equal 0, <%= file_name %>_item_count(nil_items_data)
|
92
|
-
end
|
93
|
-
|
94
|
-
test "returns summary metrics" do
|
95
|
-
metrics = <%= file_name %>_summary_metrics(@sample_data)
|
96
|
-
|
97
|
-
assert_equal "42", metrics[:value]
|
98
|
-
assert_equal "Good", metrics[:status]
|
99
|
-
assert_includes metrics[:last_updated], "ago"
|
100
|
-
assert_equal 2, metrics[:item_count]
|
101
|
-
end
|
102
|
-
|
103
|
-
test "returns trend indicators" do
|
104
|
-
up_data = @sample_data.merge(trend: :up)
|
105
|
-
assert_equal "📈", <%= file_name %>_trend_indicator(up_data)
|
106
|
-
|
107
|
-
down_data = @sample_data.merge(trend: :down)
|
108
|
-
assert_equal "📉", <%= file_name %>_trend_indicator(down_data)
|
109
|
-
|
110
|
-
stable_data = @sample_data.merge(trend: :stable)
|
111
|
-
assert_equal "➡️", <%= file_name %>_trend_indicator(stable_data)
|
112
|
-
|
113
|
-
no_trend_data = @sample_data.except(:trend)
|
114
|
-
assert_equal "", <%= file_name %>_trend_indicator(no_trend_data)
|
115
|
-
end
|
116
|
-
|
117
|
-
test "returns priority class for items" do
|
118
|
-
high_priority_item = { priority: "high" }
|
119
|
-
assert_equal "priority-high", <%= file_name %>_priority_class(high_priority_item)
|
120
|
-
|
121
|
-
low_priority_item = { priority: "low" }
|
122
|
-
assert_equal "priority-low", <%= file_name %>_priority_class(low_priority_item)
|
123
|
-
|
124
|
-
no_priority_item = { name: "test" }
|
125
|
-
assert_equal "", <%= file_name %>_priority_class(no_priority_item)
|
126
|
-
end
|
127
|
-
|
128
|
-
test "formats item values correctly" do
|
129
|
-
large_value_item = { value: 1500 }
|
130
|
-
assert_equal "1,500", <%= file_name %>_format_item_value(large_value_item)
|
131
|
-
|
132
|
-
small_value_item = { value: 42 }
|
133
|
-
assert_equal "42", <%= file_name %>_format_item_value(small_value_item)
|
134
|
-
|
135
|
-
string_value_item = { value: "test" }
|
136
|
-
assert_equal "test", <%= file_name %>_format_item_value(string_value_item)
|
137
|
-
end
|
138
|
-
|
139
|
-
test "handles edge cases" do
|
140
|
-
# Test with nil data
|
141
|
-
nil_data = nil
|
142
|
-
assert_equal "", <%= file_name %>_priority_class(nil_data)
|
143
|
-
assert_equal "", <%= file_name %>_format_item_value(nil_data)
|
144
|
-
|
145
|
-
# Test with empty hash
|
146
|
-
empty_hash = {}
|
147
|
-
assert_equal "status-ok", <%= file_name %>_status_class(empty_hash)
|
148
|
-
assert_equal "❓", <%= file_name %>_status_icon(empty_hash)
|
149
|
-
assert_equal "Unknown", <%= file_name %>_status_text(empty_hash)
|
150
|
-
|
151
|
-
# Test with missing items
|
152
|
-
no_items = { value: 10 }
|
153
|
-
refute <%= file_name %>_has_items?(no_items)
|
154
|
-
assert_equal 0, <%= file_name %>_item_count(no_items)
|
155
|
-
end
|
156
|
-
|
157
|
-
test "handles different status values" do
|
158
|
-
statuses = [:good, :warning, :critical, :info, :unknown]
|
159
|
-
|
160
|
-
statuses.each do |status|
|
161
|
-
test_data = @sample_data.merge(status: status)
|
162
|
-
|
163
|
-
case status
|
164
|
-
when :good
|
165
|
-
assert_equal "✅", <%= file_name %>_status_icon(test_data)
|
166
|
-
assert_equal "Good", <%= file_name %>_status_text(test_data)
|
167
|
-
when :warning
|
168
|
-
assert_equal "⚠️", <%= file_name %>_status_icon(test_data)
|
169
|
-
assert_equal "Warning", <%= file_name %>_status_text(test_data)
|
170
|
-
when :critical
|
171
|
-
assert_equal "❌", <%= file_name %>_status_icon(test_data)
|
172
|
-
assert_equal "Critical", <%= file_name %>_status_text(test_data)
|
173
|
-
when :info
|
174
|
-
assert_equal "ℹ️", <%= file_name %>_status_icon(test_data)
|
175
|
-
assert_equal "Info", <%= file_name %>_status_text(test_data)
|
176
|
-
else
|
177
|
-
assert_equal "❓", <%= file_name %>_status_icon(test_data)
|
178
|
-
assert_equal "Unknown", <%= file_name %>_status_text(test_data)
|
179
|
-
end
|
180
|
-
end
|
181
|
-
end
|
182
|
-
end
|
183
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module Solidstats
|
2
|
-
class <%= class_name %>Controller < ApplicationController
|
3
|
-
before_action :development_only
|
4
|
-
before_action :load_service
|
5
|
-
|
6
|
-
def index
|
7
|
-
@data = @service.detailed_data
|
8
|
-
|
9
|
-
respond_to do |format|
|
10
|
-
format.html
|
11
|
-
format.json { render json: @data }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def refresh
|
16
|
-
@data = @service.fetch(true)
|
17
|
-
|
18
|
-
respond_to do |format|
|
19
|
-
format.html { redirect_to solidstats.<%= file_name %>_path, notice: '<%= human_name %> data refreshed successfully.' }
|
20
|
-
format.json { render json: @data }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def summary
|
25
|
-
summary_data = @service.summary
|
26
|
-
|
27
|
-
respond_to do |format|
|
28
|
-
format.json { render json: summary_data }
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def load_service
|
35
|
-
@service = <%= class_name %>Service.new
|
36
|
-
end
|
37
|
-
|
38
|
-
def development_only
|
39
|
-
unless Rails.env.development?
|
40
|
-
head :not_found
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,111 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
module Solidstats
|
4
|
-
class <%= class_name %>ControllerTest < ActionDispatch::IntegrationTest
|
5
|
-
include Engine.routes.url_helpers
|
6
|
-
|
7
|
-
def setup
|
8
|
-
# Ensure we're in development mode for tests
|
9
|
-
Rails.env.stub(:development?, true) do
|
10
|
-
@service = <%= class_name %>Service.new
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
test "should get index in development" do
|
15
|
-
Rails.env.stub(:development?, true) do
|
16
|
-
get <%= file_name %>_path
|
17
|
-
assert_response :success
|
18
|
-
assert_template :index
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
test "should not get index in production" do
|
23
|
-
Rails.env.stub(:development?, false) do
|
24
|
-
get <%= file_name %>_path
|
25
|
-
assert_response :not_found
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
test "should get index as json" do
|
30
|
-
Rails.env.stub(:development?, true) do
|
31
|
-
get <%= file_name %>_path, as: :json
|
32
|
-
assert_response :success
|
33
|
-
assert_match "application/json", response.content_type
|
34
|
-
|
35
|
-
json_response = JSON.parse(response.body)
|
36
|
-
assert json_response.key?("value")
|
37
|
-
assert json_response.key?("items")
|
38
|
-
assert json_response.key?("breakdown")
|
39
|
-
assert json_response.key?("trends")
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
test "should refresh data" do
|
44
|
-
Rails.env.stub(:development?, true) do
|
45
|
-
post refresh_<%= file_name %>_path if respond_to?(:refresh_<%= file_name %>_path)
|
46
|
-
|
47
|
-
# If refresh route doesn't exist, test the service directly
|
48
|
-
data = @service.fetch(true)
|
49
|
-
assert_not_nil data
|
50
|
-
assert data.key?(:value)
|
51
|
-
assert data.key?(:last_updated)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
test "should get summary as json" do
|
56
|
-
Rails.env.stub(:development?, true) do
|
57
|
-
get summary_<%= file_name %>_path if respond_to?(:summary_<%= file_name %>_path)
|
58
|
-
|
59
|
-
# If summary route doesn't exist, test the service directly
|
60
|
-
summary = @service.summary
|
61
|
-
assert_not_nil summary
|
62
|
-
assert summary.key?(:value)
|
63
|
-
assert summary.key?(:status)
|
64
|
-
assert summary.key?(:last_updated)
|
65
|
-
assert summary.key?(:count)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
test "should assign service data to view" do
|
70
|
-
Rails.env.stub(:development?, true) do
|
71
|
-
get <%= file_name %>_path
|
72
|
-
assert_response :success
|
73
|
-
assert_not_nil assigns(:data)
|
74
|
-
assert_kind_of Hash, assigns(:data)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
test "should handle service errors gracefully" do
|
79
|
-
Rails.env.stub(:development?, true) do
|
80
|
-
# Mock service to raise an error
|
81
|
-
<%= class_name %>Service.any_instance.stub(:detailed_data, -> { raise StandardError.new("Test error") }) do
|
82
|
-
assert_raises StandardError do
|
83
|
-
get <%= file_name %>_path
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
test "should validate required instance variables" do
|
90
|
-
Rails.env.stub(:development?, true) do
|
91
|
-
get <%= file_name %>_path
|
92
|
-
assert_response :success
|
93
|
-
|
94
|
-
# Check that controller sets up required data
|
95
|
-
assert_not_nil assigns(:data)
|
96
|
-
assert assigns(:data).key?(:value)
|
97
|
-
assert assigns(:data).key?(:items)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
test "should have proper security headers" do
|
102
|
-
Rails.env.stub(:development?, true) do
|
103
|
-
get <%= file_name %>_path
|
104
|
-
assert_response :success
|
105
|
-
|
106
|
-
# Verify development-only access is enforced
|
107
|
-
assert_not_nil response.headers
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|