seofy 0.0.2 → 0.0.3
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/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/Rakefile +5 -0
- data/lib/seofy/active_record.rb +1 -1
- data/lib/seofy/version.rb +1 -1
- data/spec/integration/base36_spec.rb +2 -2
- data/spec/integration/existing_column_spec.rb +2 -2
- data/spec/lib/seofy/active_record_spec.rb +3 -3
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
data/lib/seofy/active_record.rb
CHANGED
data/lib/seofy/version.rb
CHANGED
@@ -6,12 +6,12 @@ describe "slug use base36", :integration => true do
|
|
6
6
|
end
|
7
7
|
it "should generate slug automaticly use base36" do
|
8
8
|
@store.slug.length.should == 3
|
9
|
-
@store.
|
9
|
+
@store.seofy_param.should == "a-store-#{@store.slug}"
|
10
10
|
end
|
11
11
|
|
12
12
|
describe "for_slug" do
|
13
13
|
it "should find the record" do
|
14
|
-
Store.for_seofy(@store.
|
14
|
+
Store.for_seofy(@store.seofy_param).should == @store
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -7,13 +7,13 @@ describe "slug for existing_column", :integration => true do
|
|
7
7
|
|
8
8
|
describe "to_param" do
|
9
9
|
it "should equal to combined slugs" do
|
10
|
-
@user.
|
10
|
+
@user.seofy_param.should == "a-user-name-slug"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
describe "for_slug" do
|
15
15
|
it "should find the record" do
|
16
|
-
User.for_seofy(@user.
|
16
|
+
User.for_seofy(@user.seofy_param).should == @user
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -38,7 +38,7 @@ describe Seofy::ActiveRecord do
|
|
38
38
|
|
39
39
|
context "instance methods" do
|
40
40
|
subject {@klass.new }
|
41
|
-
it { should be_respond_to(:
|
41
|
+
it { should be_respond_to(:seofy_param)}
|
42
42
|
it { should be_respond_to(:seofy_slug)}
|
43
43
|
it { should be_respond_to(:seofy_source)}
|
44
44
|
end
|
@@ -60,12 +60,12 @@ describe Seofy::ActiveRecord do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
describe "#
|
63
|
+
describe "#seofy_param" do
|
64
64
|
it "should normalize source and join with slug" do
|
65
65
|
inst = @klass.new
|
66
66
|
inst.should_receive(:seofy_slug).and_return("abc")
|
67
67
|
inst.should_receive(:seofy_source).and_return("a normalize name")
|
68
|
-
inst.
|
68
|
+
inst.seofy_param.should == "a-normalize-name-abc"
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
metadata
CHANGED