semantically-taggable 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,7 @@ describe "Tagging articles" do
18
18
  Article.tag_counts_on(:keywords).all.should be_empty
19
19
 
20
20
  @article.keyword_list = ["awesome", "epic"]
21
+ @article.ipsv_subject_list = ["epic", "match"]
21
22
  @article.save
22
23
 
23
24
  Article.tag_counts_on(:keywords).length.should == 2
@@ -0,0 +1,28 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ describe SemanticallyTaggable::TagsHelper do
4
+ before(:all) do
5
+ reset_database!
6
+
7
+ @bob = Article.create(:name => "Inheritance tax", :keyword_list => "tax, children")
8
+ @tom = Article.create(:name => "Income Tax", :keyword_list => "tax, income")
9
+ @eve = Article.create(:name => "Road Tax", :keyword_list => "tax, road")
10
+ end
11
+
12
+ before(:each) do
13
+ @helper = class Helper
14
+ include SemanticallyTaggable::TagsHelper
15
+ end.new
16
+
17
+ @classes = {}
18
+
19
+ @helper.tag_cloud(Article.tag_counts_on(:keywords), ["less", "prominent"]) do |tag, css_class|
20
+ @classes[tag.name] = css_class
21
+ end
22
+ end
23
+
24
+ specify { @classes["tax"].should == "prominent" }
25
+ specify { @classes["benefits"].should be_nil }
26
+ specify { @classes["road"].should == "less" }
27
+ specify { @classes["children"].should == "less" }
28
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantically-taggable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 10
10
+ version: 0.1.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Russell Garner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-27 00:00:00 +00:00
18
+ date: 2011-01-28 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -166,6 +166,7 @@ files:
166
166
  - lib/semantically_taggable/tag_list.rb
167
167
  - lib/semantically_taggable/tag_parentage.rb
168
168
  - lib/semantically_taggable/tagging.rb
169
+ - lib/semantically_taggable/tags_helper.rb
169
170
  - lib/tasks/import.rake
170
171
  - spec/database.yml
171
172
  - spec/database.yml.sample
@@ -180,6 +181,7 @@ files:
180
181
  - spec/semantically_taggable/tag_list_spec.rb
181
182
  - spec/semantically_taggable/tag_parentage_spec.rb
182
183
  - spec/semantically_taggable/tag_spec.rb
184
+ - spec/semantically_taggable/tags_helper_spec.rb
183
185
  - spec/semantically_taggable/testdata/dg_abridged.rdf
184
186
  - spec/semantically_taggable/testdata/dg_two_roots.rdf
185
187
  - spec/spec_helper.rb
@@ -230,4 +232,5 @@ test_files:
230
232
  - spec/semantically_taggable/tag_list_spec.rb
231
233
  - spec/semantically_taggable/tag_parentage_spec.rb
232
234
  - spec/semantically_taggable/tag_spec.rb
235
+ - spec/semantically_taggable/tags_helper_spec.rb
233
236
  - spec/spec_helper.rb