seofy 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/seofy/task_runner.rb +1 -1
- data/lib/seofy/version.rb +1 -1
- data/spec/lib/seofy/task_runner_spec.rb +11 -3
- data/spec/models.rb +1 -0
- data/spec/models_migration.rb +1 -0
- metadata +3 -3
data/lib/seofy/task_runner.rb
CHANGED
data/lib/seofy/version.rb
CHANGED
@@ -10,20 +10,28 @@ describe Seofy::TaskRunner do
|
|
10
10
|
|
11
11
|
describe "#update_all" do
|
12
12
|
it "should update all slugs" do
|
13
|
-
s1 = Store.create!("store 1")
|
13
|
+
s1 = Store.create!(:title => "store 1")
|
14
14
|
slug1 = s1.slug
|
15
15
|
ENV["MODELS"] = "Store"
|
16
16
|
Seofy::TaskRunner.new.update_all
|
17
17
|
s1.reload.should_not == slug1
|
18
18
|
end
|
19
|
+
it "should ignore default_scope" do
|
20
|
+
s1 = Store.create!(:title => "store 1", :deleted => 1)
|
21
|
+
slug1 = s1.slug
|
22
|
+
ENV["MODELS"] = "Store"
|
23
|
+
Seofy::TaskRunner.new.update_all
|
24
|
+
Store.unscoped.find(s1.id).reload.should_not == slug1
|
25
|
+
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
describe "#update_null" do
|
22
30
|
it "should update all null slugs" do
|
23
|
-
s1 = Store.create!("store 1")
|
31
|
+
s1 = Store.create!(:title => "store 1")
|
24
32
|
Store.connection.execute("update stores set slug = NULL")
|
25
33
|
s1.reload.slug.should be_nil
|
26
|
-
s2 = Store.create!("store 1")
|
34
|
+
s2 = Store.create!(:title => "store 1")
|
27
35
|
old_slug = s2.slug
|
28
36
|
ENV["MODELS"] = "Store"
|
29
37
|
Seofy::TaskRunner.new.update_all
|
data/spec/models.rb
CHANGED
data/spec/models_migration.rb
CHANGED
metadata
CHANGED