citier4 0.0.4 → 0.0.5
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/lib/citier4/child_instance_methods.rb +2 -2
- data/lib/citier4/version.rb +1 -1
- data/test/dummy/app/models/book.rb +1 -1
- data/test/dummy/app/models/product.rb +1 -1
- data/test/dummy/log/test.log +7422 -0
- data/test/model_test.rb +2 -2
- data/test/saving_methods_test.rb +15 -1
- metadata +1 -1
data/test/model_test.rb
CHANGED
|
@@ -23,12 +23,12 @@ class Model < ActiveSupport::TestCase
|
|
|
23
23
|
|
|
24
24
|
test "book name sould be present" do
|
|
25
25
|
@book.name =""
|
|
26
|
-
|
|
26
|
+
assert_not @book.valid?
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
test "book author sould be present" do
|
|
30
30
|
@book.author =""
|
|
31
|
-
|
|
31
|
+
assert_not @book.valid?
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
end
|
data/test/saving_methods_test.rb
CHANGED
|
@@ -10,7 +10,7 @@ class SavingMethods < ActiveSupport::TestCase
|
|
|
10
10
|
test "update in child" do
|
|
11
11
|
|
|
12
12
|
book = Book.create name: "UnNom", author: "UnAuteur"
|
|
13
|
-
debugger
|
|
13
|
+
# debugger
|
|
14
14
|
puts "product name: #{book.name}, author: #{book.author}"
|
|
15
15
|
newName = "CeciEstUnNouveauNom"
|
|
16
16
|
newAuthor ="CeciEstUnNouveauAuteur"
|
|
@@ -24,4 +24,18 @@ class SavingMethods < ActiveSupport::TestCase
|
|
|
24
24
|
assert_equal newAuthor, author
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
|
|
28
|
+
test "update in child with valid? " do
|
|
29
|
+
|
|
30
|
+
book = Book.create name: "UnNom", author: "UnAuteur"
|
|
31
|
+
debugger
|
|
32
|
+
puts "product name: #{book.name}, author: #{book.author}"
|
|
33
|
+
newAuthor ="CeciEstUnNouveauAuteur"
|
|
34
|
+
book.author = newAuthor
|
|
35
|
+
assert book.save
|
|
36
|
+
book_in_base = @connection.execute("SELECT author FROM view_books WHERE id = #{book.id}")[0]
|
|
37
|
+
author = book_in_base["author"]
|
|
38
|
+
assert_equal newAuthor, author
|
|
39
|
+
end
|
|
40
|
+
|
|
27
41
|
end
|