books 0.0.1 → 0.0.2

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.
Files changed (41) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +1 -1
  3. data/Rakefile +1 -1
  4. data/app/assets/javascripts/{book → books}/application.js +0 -0
  5. data/app/assets/stylesheets/{book → books}/application.css +0 -0
  6. data/app/controllers/{book → books}/application_controller.rb +1 -1
  7. data/app/helpers/{book → books}/application_helper.rb +1 -1
  8. data/app/views/layouts/books/application.html.erb +14 -0
  9. data/config/routes.rb +1 -4
  10. data/lib/books.rb +4 -0
  11. data/lib/{book → books}/engine.rb +2 -2
  12. data/lib/books/version.rb +3 -0
  13. data/lib/tasks/{book_tasks.rake → books_tasks.rake} +1 -1
  14. data/test/books_test.rb +7 -0
  15. data/test/dummy/config/application.rb +1 -1
  16. data/test/dummy/config/initializers/secret_token.rb +1 -1
  17. data/test/dummy/config/routes.rb +1 -1
  18. metadata +32 -41
  19. data/app/assets/javascripts/book/books.js +0 -2
  20. data/app/assets/stylesheets/book/books.css +0 -4
  21. data/app/assets/stylesheets/scaffold.css +0 -56
  22. data/app/controllers/book/books_controller.rb +0 -87
  23. data/app/helpers/book/books_helper.rb +0 -4
  24. data/app/models/book/book.rb +0 -5
  25. data/app/views/book/books/_form.html.erb +0 -33
  26. data/app/views/book/books/edit.html.erb +0 -6
  27. data/app/views/book/books/index.html.erb +0 -29
  28. data/app/views/book/books/new.html.erb +0 -5
  29. data/app/views/book/books/show.html.erb +0 -25
  30. data/app/views/layouts/book/application.html.erb +0 -14
  31. data/db/migrate/20130126052634_create_book_books.rb +0 -12
  32. data/lib/book.rb +0 -4
  33. data/lib/book/version.rb +0 -3
  34. data/test/book_test.rb +0 -7
  35. data/test/dummy/db/development.sqlite3 +0 -0
  36. data/test/dummy/db/schema.rb +0 -25
  37. data/test/dummy/log/development.log +0 -11
  38. data/test/fixtures/book/books.yml +0 -13
  39. data/test/functional/book/books_controller_test.rb +0 -51
  40. data/test/unit/book/book_test.rb +0 -9
  41. data/test/unit/helpers/book/books_helper_test.rb +0 -6
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
- = Book
1
+ = Books
2
2
 
3
3
  This project rocks and uses MIT-LICENSE.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ end
14
14
 
15
15
  RDoc::Task.new(:rdoc) do |rdoc|
16
16
  rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'Book'
17
+ rdoc.title = 'Books'
18
18
  rdoc.options << '--line-numbers'
19
19
  rdoc.rdoc_files.include('README.rdoc')
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
@@ -1,4 +1,4 @@
1
- module Book
1
+ module Books
2
2
  class ApplicationController < ActionController::Base
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Book
1
+ module Books
2
2
  module ApplicationHelper
3
3
  end
4
4
  end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Books</title>
5
+ <%= stylesheet_link_tag "books/application", :media => "all" %>
6
+ <%= javascript_include_tag "books/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
data/config/routes.rb CHANGED
@@ -1,5 +1,2 @@
1
- Book::Engine.routes.draw do
2
- resources :books
3
-
4
-
1
+ Books::Engine.routes.draw do
5
2
  end
data/lib/books.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "books/engine"
2
+
3
+ module Books
4
+ end
@@ -1,5 +1,5 @@
1
- module Book
1
+ module Books
2
2
  class Engine < ::Rails::Engine
3
- isolate_namespace Book
3
+ isolate_namespace Books
4
4
  end
5
5
  end
@@ -0,0 +1,3 @@
1
+ module Books
2
+ VERSION = "0.0.2"
3
+ end
@@ -1,4 +1,4 @@
1
1
  # desc "Explaining what the task does"
2
- # task :book do
2
+ # task :books do
3
3
  # # Task goes here
4
4
  # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class BooksTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Books
6
+ end
7
+ end
@@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__)
3
3
  require 'rails/all'
4
4
 
5
5
  Bundler.require
6
- require "book"
6
+ require "books"
7
7
 
8
8
  module Dummy
9
9
  class Application < Rails::Application
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = 'ea7b14e2f0073ff72ac109575fec79c64f2a6407ed1ad9e6b40f9886d9319a79b4317b571ada7d1447f0af428540a88b117ac2212aeb9011531c0d11da96c5f4'
7
+ Dummy::Application.config.secret_token = '92fe454c835c78b09c801670ec2d3702e177b5c5518af815889ac5e1a6ec5954bb82a6091b3389331a98a516c7b5664851c50ece5459bc84be530d7dd7d5b73c'
@@ -1,4 +1,4 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
- mount Book::Engine => "/book"
3
+ mount Books::Engine => "/books"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: books
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,39 +27,43 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.2.11
30
- description: Read books by pages, upload e-books.
30
+ - !ruby/object:Gem::Dependency
31
+ name: sqlite3
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Read and upload e-books. Distributed as Rails mountable engine
31
47
  email:
32
48
  - zj137@163.com
33
49
  executables: []
34
50
  extensions: []
35
51
  extra_rdoc_files: []
36
52
  files:
37
- - app/models/book/book.rb
38
- - app/views/layouts/book/application.html.erb
39
- - app/views/book/books/show.html.erb
40
- - app/views/book/books/new.html.erb
41
- - app/views/book/books/index.html.erb
42
- - app/views/book/books/edit.html.erb
43
- - app/views/book/books/_form.html.erb
44
- - app/assets/javascripts/book/books.js
45
- - app/assets/javascripts/book/application.js
46
- - app/assets/stylesheets/scaffold.css
47
- - app/assets/stylesheets/book/books.css
48
- - app/assets/stylesheets/book/application.css
49
- - app/helpers/book/application_helper.rb
50
- - app/helpers/book/books_helper.rb
51
- - app/controllers/book/books_controller.rb
52
- - app/controllers/book/application_controller.rb
53
+ - app/views/layouts/books/application.html.erb
54
+ - app/assets/javascripts/books/application.js
55
+ - app/assets/stylesheets/books/application.css
56
+ - app/helpers/books/application_helper.rb
57
+ - app/controllers/books/application_controller.rb
53
58
  - config/routes.rb
54
- - db/migrate/20130126052634_create_book_books.rb
55
- - lib/book.rb
56
- - lib/tasks/book_tasks.rake
57
- - lib/book/version.rb
58
- - lib/book/engine.rb
59
+ - lib/books.rb
60
+ - lib/books/version.rb
61
+ - lib/books/engine.rb
62
+ - lib/tasks/books_tasks.rake
63
+ - MIT-LICENSE
59
64
  - Rakefile
60
65
  - README.md
61
66
  - test/dummy/config.ru
62
- - test/dummy/log/development.log
63
67
  - test/dummy/config/boot.rb
64
68
  - test/dummy/config/application.rb
65
69
  - test/dummy/config/database.yml
@@ -83,20 +87,14 @@ files:
83
87
  - test/dummy/app/assets/stylesheets/application.css
84
88
  - test/dummy/app/helpers/application_helper.rb
85
89
  - test/dummy/app/controllers/application_controller.rb
86
- - test/dummy/db/schema.rb
87
- - test/dummy/db/development.sqlite3
88
90
  - test/dummy/public/404.html
89
91
  - test/dummy/public/422.html
90
92
  - test/dummy/public/500.html
91
93
  - test/dummy/public/favicon.ico
92
94
  - test/test_helper.rb
93
95
  - test/integration/navigation_test.rb
94
- - test/unit/helpers/book/books_helper_test.rb
95
- - test/unit/book/book_test.rb
96
- - test/book_test.rb
97
- - test/functional/book/books_controller_test.rb
98
- - test/fixtures/book/books.yml
99
- homepage: http://mystory.cc/
96
+ - test/books_test.rb
97
+ homepage: http://zhangjian.mystory.cc/
100
98
  licenses: []
101
99
  post_install_message:
102
100
  rdoc_options: []
@@ -119,10 +117,9 @@ rubyforge_project:
119
117
  rubygems_version: 1.8.24
120
118
  signing_key:
121
119
  specification_version: 3
122
- summary: Read and upload e-books plugin for rails App
120
+ summary: Read and upload e-books. Distributed as Rails mountable engine
123
121
  test_files:
124
122
  - test/dummy/config.ru
125
- - test/dummy/log/development.log
126
123
  - test/dummy/config/boot.rb
127
124
  - test/dummy/config/application.rb
128
125
  - test/dummy/config/database.yml
@@ -146,16 +143,10 @@ test_files:
146
143
  - test/dummy/app/assets/stylesheets/application.css
147
144
  - test/dummy/app/helpers/application_helper.rb
148
145
  - test/dummy/app/controllers/application_controller.rb
149
- - test/dummy/db/schema.rb
150
- - test/dummy/db/development.sqlite3
151
146
  - test/dummy/public/404.html
152
147
  - test/dummy/public/422.html
153
148
  - test/dummy/public/500.html
154
149
  - test/dummy/public/favicon.ico
155
150
  - test/test_helper.rb
156
151
  - test/integration/navigation_test.rb
157
- - test/unit/helpers/book/books_helper_test.rb
158
- - test/unit/book/book_test.rb
159
- - test/book_test.rb
160
- - test/functional/book/books_controller_test.rb
161
- - test/fixtures/book/books.yml
152
+ - test/books_test.rb
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,56 +0,0 @@
1
- body { background-color: #fff; color: #333; }
2
-
3
- body, p, ol, ul, td {
4
- font-family: verdana, arial, helvetica, sans-serif;
5
- font-size: 13px;
6
- line-height: 18px;
7
- }
8
-
9
- pre {
10
- background-color: #eee;
11
- padding: 10px;
12
- font-size: 11px;
13
- }
14
-
15
- a { color: #000; }
16
- a:visited { color: #666; }
17
- a:hover { color: #fff; background-color:#000; }
18
-
19
- div.field, div.actions {
20
- margin-bottom: 10px;
21
- }
22
-
23
- #notice {
24
- color: green;
25
- }
26
-
27
- .field_with_errors {
28
- padding: 2px;
29
- background-color: red;
30
- display: table;
31
- }
32
-
33
- #error_explanation {
34
- width: 450px;
35
- border: 2px solid red;
36
- padding: 7px;
37
- padding-bottom: 0;
38
- margin-bottom: 20px;
39
- background-color: #f0f0f0;
40
- }
41
-
42
- #error_explanation h2 {
43
- text-align: left;
44
- font-weight: bold;
45
- padding: 5px 5px 5px 15px;
46
- font-size: 12px;
47
- margin: -7px;
48
- margin-bottom: 0px;
49
- background-color: #c00;
50
- color: #fff;
51
- }
52
-
53
- #error_explanation ul li {
54
- font-size: 12px;
55
- list-style: square;
56
- }
@@ -1,87 +0,0 @@
1
- require_dependency "book/application_controller"
2
-
3
- module Book
4
- class BooksController < ApplicationController
5
- # GET /books
6
- # GET /books.json
7
- def index
8
- @books = Book.all
9
-
10
- respond_to do |format|
11
- format.html # index.html.erb
12
- format.json { render json: @books }
13
- end
14
- end
15
-
16
- # GET /books/1
17
- # GET /books/1.json
18
- def show
19
- @book = Book.find(params[:id])
20
-
21
- respond_to do |format|
22
- format.html # show.html.erb
23
- format.json { render json: @book }
24
- end
25
- end
26
-
27
- # GET /books/new
28
- # GET /books/new.json
29
- def new
30
- @book = Book.new
31
-
32
- respond_to do |format|
33
- format.html # new.html.erb
34
- format.json { render json: @book }
35
- end
36
- end
37
-
38
- # GET /books/1/edit
39
- def edit
40
- @book = Book.find(params[:id])
41
- end
42
-
43
- # POST /books
44
- # POST /books.json
45
- def create
46
- @book = Book.new(params[:book])
47
-
48
- respond_to do |format|
49
- if @book.save
50
- format.html { redirect_to @book, notice: 'Book was successfully created.' }
51
- format.json { render json: @book, status: :created, location: @book }
52
- else
53
- format.html { render action: "new" }
54
- format.json { render json: @book.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # PUT /books/1
60
- # PUT /books/1.json
61
- def update
62
- @book = Book.find(params[:id])
63
-
64
- respond_to do |format|
65
- if @book.update_attributes(params[:book])
66
- format.html { redirect_to @book, notice: 'Book was successfully updated.' }
67
- format.json { head :no_content }
68
- else
69
- format.html { render action: "edit" }
70
- format.json { render json: @book.errors, status: :unprocessable_entity }
71
- end
72
- end
73
- end
74
-
75
- # DELETE /books/1
76
- # DELETE /books/1.json
77
- def destroy
78
- @book = Book.find(params[:id])
79
- @book.destroy
80
-
81
- respond_to do |format|
82
- format.html { redirect_to books_url }
83
- format.json { head :no_content }
84
- end
85
- end
86
- end
87
- end
@@ -1,4 +0,0 @@
1
- module Book
2
- module BooksHelper
3
- end
4
- end
@@ -1,5 +0,0 @@
1
- module Book
2
- class Book < ActiveRecord::Base
3
- attr_accessible :body, :summary, :title, :writer
4
- end
5
- end
@@ -1,33 +0,0 @@
1
- <%= form_for(@book) do |f| %>
2
- <% if @book.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@book.errors.count, "error") %> prohibited this book from being saved:</h2>
5
-
6
- <ul>
7
- <% @book.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="field">
15
- <%= f.label :title %><br />
16
- <%= f.text_field :title %>
17
- </div>
18
- <div class="field">
19
- <%= f.label :summary %><br />
20
- <%= f.text_area :summary %>
21
- </div>
22
- <div class="field">
23
- <%= f.label :body %><br />
24
- <%= f.text_area :body %>
25
- </div>
26
- <div class="field">
27
- <%= f.label :writer %><br />
28
- <%= f.text_field :writer %>
29
- </div>
30
- <div class="actions">
31
- <%= f.submit %>
32
- </div>
33
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing book</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @book %> |
6
- <%= link_to 'Back', books_path %>
@@ -1,29 +0,0 @@
1
- <h1>Listing books</h1>
2
-
3
- <table>
4
- <tr>
5
- <th>Title</th>
6
- <th>Summary</th>
7
- <th>Body</th>
8
- <th>Writer</th>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
13
-
14
- <% @books.each do |book| %>
15
- <tr>
16
- <td><%= book.title %></td>
17
- <td><%= book.summary %></td>
18
- <td><%= book.body %></td>
19
- <td><%= book.writer %></td>
20
- <td><%= link_to 'Show', book %></td>
21
- <td><%= link_to 'Edit', edit_book_path(book) %></td>
22
- <td><%= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' } %></td>
23
- </tr>
24
- <% end %>
25
- </table>
26
-
27
- <br />
28
-
29
- <%= link_to 'New Book', new_book_path %>
@@ -1,5 +0,0 @@
1
- <h1>New book</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', books_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <b>Title:</b>
5
- <%= @book.title %>
6
- </p>
7
-
8
- <p>
9
- <b>Summary:</b>
10
- <%= @book.summary %>
11
- </p>
12
-
13
- <p>
14
- <b>Body:</b>
15
- <%= @book.body %>
16
- </p>
17
-
18
- <p>
19
- <b>Writer:</b>
20
- <%= @book.writer %>
21
- </p>
22
-
23
-
24
- <%= link_to 'Edit', edit_book_path(@book) %> |
25
- <%= link_to 'Back', books_path %>
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Book</title>
5
- <%= stylesheet_link_tag "book/application", :media => "all" %>
6
- <%= javascript_include_tag "book/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,12 +0,0 @@
1
- class CreateBookBooks < ActiveRecord::Migration
2
- def change
3
- create_table :book_books do |t|
4
- t.string :title
5
- t.text :summary
6
- t.text :body
7
- t.string :writer
8
-
9
- t.timestamps
10
- end
11
- end
12
- end
data/lib/book.rb DELETED
@@ -1,4 +0,0 @@
1
- require "book/engine"
2
-
3
- module Book
4
- end
data/lib/book/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module Book
2
- VERSION = "0.0.1"
3
- end
data/test/book_test.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class BookTest < ActiveSupport::TestCase
4
- test "truth" do
5
- assert_kind_of Module, Book
6
- end
7
- end
Binary file
@@ -1,25 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 20130126052634) do
15
-
16
- create_table "book_books", :force => true do |t|
17
- t.string "title"
18
- t.text "summary"
19
- t.text "body"
20
- t.string "writer"
21
- t.datetime "created_at", :null => false
22
- t.datetime "updated_at", :null => false
23
- end
24
-
25
- end
@@ -1,11 +0,0 @@
1
- Connecting to database specified by database.yml
2
-  (0.1ms) select sqlite_version(*)
3
-  (116.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
4
-  (65.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
-  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
6
- Migrating to CreateBookBooks (20130126052634)
7
-  (0.1ms) begin transaction
8
-  (0.4ms) CREATE TABLE "book_books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "summary" text, "body" text, "writer" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
9
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130126052634')
10
-  (121.0ms) commit transaction
11
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
@@ -1,13 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
-
3
- one:
4
- title: MyString
5
- summary: MyText
6
- body: MyText
7
- writer: MyString
8
-
9
- two:
10
- title: MyString
11
- summary: MyText
12
- body: MyText
13
- writer: MyString
@@ -1,51 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Book
4
- class BooksControllerTest < ActionController::TestCase
5
- setup do
6
- @book = books(:one)
7
- end
8
-
9
- test "should get index" do
10
- get :index
11
- assert_response :success
12
- assert_not_nil assigns(:books)
13
- end
14
-
15
- test "should get new" do
16
- get :new
17
- assert_response :success
18
- end
19
-
20
- test "should create book" do
21
- assert_difference('Book.count') do
22
- post :create, book: { body: @book.body, summary: @book.summary, title: @book.title, writer: @book.writer }
23
- end
24
-
25
- assert_redirected_to book_path(assigns(:book))
26
- end
27
-
28
- test "should show book" do
29
- get :show, id: @book
30
- assert_response :success
31
- end
32
-
33
- test "should get edit" do
34
- get :edit, id: @book
35
- assert_response :success
36
- end
37
-
38
- test "should update book" do
39
- put :update, id: @book, book: { body: @book.body, summary: @book.summary, title: @book.title, writer: @book.writer }
40
- assert_redirected_to book_path(assigns(:book))
41
- end
42
-
43
- test "should destroy book" do
44
- assert_difference('Book.count', -1) do
45
- delete :destroy, id: @book
46
- end
47
-
48
- assert_redirected_to books_path
49
- end
50
- end
51
- end
@@ -1,9 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Book
4
- class BookTest < ActiveSupport::TestCase
5
- # test "the truth" do
6
- # assert true
7
- # end
8
- end
9
- end
@@ -1,6 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Book
4
- class BooksHelperTest < ActionView::TestCase
5
- end
6
- end