semantically-taggable 0.4.0 → 0.4.1
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.
- data/lib/semantically_taggable/scheme.rb +3 -2
- data/lib/semantically_taggable/tag.rb +3 -2
- data/spec/debug.log +17447 -0
- data/spec/models.rb +1 -1
- data/spec/semantically_taggable/article_tagging_spec.rb +27 -7
- metadata +4 -3
data/spec/models.rb
CHANGED
@@ -14,15 +14,35 @@ describe "Tagging articles" do
|
|
14
14
|
@article.scheme_names.should == Article.scheme_names
|
15
15
|
end
|
16
16
|
|
17
|
-
it "should have tag_counts_on" do
|
18
|
-
Article.tag_counts_on(:keywords).all.should be_empty
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
describe "counting things" do
|
19
|
+
before :each do
|
20
|
+
Article.tag_counts_on(:keywords).all.should be_empty
|
21
|
+
|
22
|
+
@article.keyword_list = ["awesome", "epic"]
|
23
|
+
@article.ipsv_subject_list = ["epic", "match"]
|
24
|
+
@article.save
|
25
|
+
|
26
|
+
Contact.create(:contact_point => 'Lionel Messi', :keyword_list => ['awesome', 'player'])
|
27
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
28
|
+
end
|
29
|
+
|
30
|
+
let(:keywords_scheme) { SemanticallyTaggable::Scheme.by_name(:keywords) }
|
31
|
+
let(:awesome_keyword) { keywords_scheme.tags.named('awesome').first }
|
23
32
|
|
24
|
-
|
25
|
-
|
33
|
+
it "should have tag_counts_on" do
|
34
|
+
Article.tag_counts_on(:keywords).length.should == 2
|
35
|
+
@article.tag_counts_on(:keywords).length.should == 2
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should be able to get Scheme#model_counts_for" do
|
39
|
+
keywords_scheme.model_counts_for('awesome', 'epic')\
|
40
|
+
.should == { 'awesome' => 2, 'epic' => 1 }
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should be able to get Tag#all_models_total" do
|
44
|
+
awesome_keyword.all_models_total.should == 2
|
45
|
+
end
|
26
46
|
end
|
27
47
|
|
28
48
|
it "should be able to create tags using the scheme's delimiter" do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: semantically-taggable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Russell Garner
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-11 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- spec/database.yml
|
145
145
|
- spec/database.yml.sample
|
146
146
|
- spec/database_seeder.rb
|
147
|
+
- spec/debug.log
|
147
148
|
- spec/models.rb
|
148
149
|
- spec/schema.rb
|
149
150
|
- spec/semantically_taggable/article_tagging_spec.rb
|
@@ -172,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
173
|
requirements:
|
173
174
|
- - ">="
|
174
175
|
- !ruby/object:Gem::Version
|
175
|
-
hash:
|
176
|
+
hash: 2889794840262054589
|
176
177
|
segments:
|
177
178
|
- 0
|
178
179
|
version: "0"
|