markup_attributes 0.1.1 → 0.1.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/Rakefile +1 -0
- data/app/helpers/markup_attributes_helper.rb +11 -1
- data/lib/markup_attributes.rb +3 -10
- data/lib/markup_attributes/version.rb +1 -1
- data/spec/dummy/db/dummy_development.sqlite3 +0 -0
- data/spec/dummy/db/dummy_test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +72 -0
- data/spec/dummy/log/test.log +3766 -0
- data/spec/models/model_usage_spec.rb +16 -0
- metadata +4 -2
@@ -0,0 +1,16 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
|
3
|
+
RSpec.describe 'using it in a model' do
|
4
|
+
class SomeModel< BasicModel
|
5
|
+
textile_attribute :body, allow: :emphasis
|
6
|
+
|
7
|
+
include MarkupAttributesHelper
|
8
|
+
def rendered_body
|
9
|
+
render_markup(body)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should use the sanitizer from the running Rails application' do
|
14
|
+
expect(SomeModel.new(body: '_hello_').rendered_body).to match_html('<em>hello</em>')
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markup_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Adam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- spec/dummy/public/apple-touch-icon.png
|
195
195
|
- spec/dummy/public/favicon.ico
|
196
196
|
- spec/helpers/markup_attributes_helper_spec.rb
|
197
|
+
- spec/models/model_usage_spec.rb
|
197
198
|
- spec/rails_helper.rb
|
198
199
|
- spec/spec_helper.rb
|
199
200
|
- spec/support/html_examples.rb
|
@@ -281,6 +282,7 @@ test_files:
|
|
281
282
|
- spec/dummy/db/dummy_development.sqlite3
|
282
283
|
- spec/dummy/log/test.log
|
283
284
|
- spec/dummy/log/development.log
|
285
|
+
- spec/models/model_usage_spec.rb
|
284
286
|
- spec/support/textile_examples.rb
|
285
287
|
- spec/support/html_examples.rb
|
286
288
|
- spec/support/matchers.rb
|