mountain_view 0.4.1 → 0.4.2
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/README.md +2 -1
- data/app/assets/stylesheets/mountain_view/styleguide.css +34 -0
- data/app/views/mountain_view/styleguide/show.html.erb +25 -12
- data/lib/mountain_view/component.rb +6 -2
- data/lib/mountain_view/version.rb +1 -1
- data/test/dummy/{db/development.sqlite3 → app/components/breadcrumbs/_breadcrumbs.html.erb} +0 -0
- data/test/dummy/{db/test.sqlite3 → app/components/breadcrumbs/breadcrumbs.css} +0 -0
- data/test/dummy/app/components/breadcrumbs/breadcrumbs.js +0 -0
- data/test/dummy/app/components/breadcrumbs/breadcrumbs.yml +0 -0
- data/test/dummy/log/development.log +1672 -1318
- data/test/dummy/log/test.log +1145 -2309
- data/test/mountain_view/component_test.rb +17 -0
- data/test/mountain_view_test.rb +18 -0
- metadata +11 -7
|
@@ -24,4 +24,21 @@ class MountainViewComponentTest < ActiveSupport::TestCase
|
|
|
24
24
|
assert_instance_of Array, component.styleguide_stubs
|
|
25
25
|
assert_equal expected_stub, component.styleguide_stubs.first
|
|
26
26
|
end
|
|
27
|
+
|
|
28
|
+
def test_stubs_file
|
|
29
|
+
component = MountainView::Component.new("header")
|
|
30
|
+
|
|
31
|
+
expected_stubs_file = Rails.root.join("app/components/header/header.yml")
|
|
32
|
+
assert_equal expected_stubs_file, component.stubs_file
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_stubs?
|
|
36
|
+
component_with_stubs = MountainView::Component.new("header")
|
|
37
|
+
component_without_stub_file = MountainView::Component.new("social_media_icons")
|
|
38
|
+
component_with_empty_stub_file = MountainView::Component.new("breadcrumbs")
|
|
39
|
+
|
|
40
|
+
assert_equal true, component_with_stubs.stubs?
|
|
41
|
+
assert_equal false, component_without_stub_file.stubs?
|
|
42
|
+
assert_equal false, component_with_empty_stub_file.stubs?
|
|
43
|
+
end
|
|
27
44
|
end
|
data/test/mountain_view_test.rb
CHANGED
|
@@ -38,6 +38,24 @@ class MountainViewTest < ActionDispatch::IntegrationTest
|
|
|
38
38
|
assert_match(/20 Mountains you didn.+t know they even existed/, response.body)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
test "shows a hint message if the component stub file is empty" do
|
|
42
|
+
get "/mountain_view/styleguide/breadcrumbs"
|
|
43
|
+
|
|
44
|
+
assert_response :success
|
|
45
|
+
assert_match(/Hint/, response.body)
|
|
46
|
+
assert_match(/You should write stub examples here:/, response.body)
|
|
47
|
+
assert_match(/app\/components\/breadcrumbs\/breadcrumbs.yml/, response.body)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
test "shows a hint message if the component stub file is not found" do
|
|
51
|
+
get "/mountain_view/styleguide/something"
|
|
52
|
+
|
|
53
|
+
assert_response :success
|
|
54
|
+
assert_match(/Hint/, response.body)
|
|
55
|
+
assert_match(/You should write stub examples here:/, response.body)
|
|
56
|
+
assert_match(/app\/components\/something\/something.yml/, response.body)
|
|
57
|
+
end
|
|
58
|
+
|
|
41
59
|
private
|
|
42
60
|
|
|
43
61
|
def clean_sprockets_cache
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mountain_view
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ignacio Gutierrez
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-04-
|
|
12
|
+
date: 2015-04-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -74,6 +74,10 @@ files:
|
|
|
74
74
|
- test/dummy/Rakefile
|
|
75
75
|
- test/dummy/app/assets/javascripts/application.js
|
|
76
76
|
- test/dummy/app/assets/stylesheets/application.css
|
|
77
|
+
- test/dummy/app/components/breadcrumbs/_breadcrumbs.html.erb
|
|
78
|
+
- test/dummy/app/components/breadcrumbs/breadcrumbs.css
|
|
79
|
+
- test/dummy/app/components/breadcrumbs/breadcrumbs.js
|
|
80
|
+
- test/dummy/app/components/breadcrumbs/breadcrumbs.yml
|
|
77
81
|
- test/dummy/app/components/card/_card.html.erb
|
|
78
82
|
- test/dummy/app/components/card/card.css
|
|
79
83
|
- test/dummy/app/components/card/card.js
|
|
@@ -110,8 +114,6 @@ files:
|
|
|
110
114
|
- test/dummy/config/locales/en.yml
|
|
111
115
|
- test/dummy/config/routes.rb
|
|
112
116
|
- test/dummy/config/secrets.yml
|
|
113
|
-
- test/dummy/db/development.sqlite3
|
|
114
|
-
- test/dummy/db/test.sqlite3
|
|
115
117
|
- test/dummy/log/development.log
|
|
116
118
|
- test/dummy/log/test.log
|
|
117
119
|
- test/dummy/public/404.html
|
|
@@ -147,13 +149,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
147
149
|
version: '0'
|
|
148
150
|
requirements: []
|
|
149
151
|
rubyforge_project:
|
|
150
|
-
rubygems_version: 2.
|
|
152
|
+
rubygems_version: 2.2.2
|
|
151
153
|
signing_key:
|
|
152
154
|
specification_version: 4
|
|
153
155
|
summary: Mountain View helps you create reusable visual components on your Rails Application.
|
|
154
156
|
test_files:
|
|
155
157
|
- test/dummy/app/assets/javascripts/application.js
|
|
156
158
|
- test/dummy/app/assets/stylesheets/application.css
|
|
159
|
+
- test/dummy/app/components/breadcrumbs/_breadcrumbs.html.erb
|
|
160
|
+
- test/dummy/app/components/breadcrumbs/breadcrumbs.css
|
|
161
|
+
- test/dummy/app/components/breadcrumbs/breadcrumbs.js
|
|
162
|
+
- test/dummy/app/components/breadcrumbs/breadcrumbs.yml
|
|
157
163
|
- test/dummy/app/components/card/_card.html.erb
|
|
158
164
|
- test/dummy/app/components/card/card.css
|
|
159
165
|
- test/dummy/app/components/card/card.js
|
|
@@ -190,8 +196,6 @@ test_files:
|
|
|
190
196
|
- test/dummy/config/routes.rb
|
|
191
197
|
- test/dummy/config/secrets.yml
|
|
192
198
|
- test/dummy/config.ru
|
|
193
|
-
- test/dummy/db/development.sqlite3
|
|
194
|
-
- test/dummy/db/test.sqlite3
|
|
195
199
|
- test/dummy/log/development.log
|
|
196
200
|
- test/dummy/log/test.log
|
|
197
201
|
- test/dummy/public/404.html
|