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.
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
- # assert_not @book.valid?
26
+ assert_not @book.valid?
27
27
  end
28
28
 
29
29
  test "book author sould be present" do
30
30
  @book.author =""
31
- # assert_not @book.valid?
31
+ assert_not @book.valid?
32
32
  end
33
33
 
34
34
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citier4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Buffat, Orignally From Peter Hamilton and others, Originally from Laurent