dailycred 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +7 -1
  4. data/dailycred.gemspec +2 -2
  5. data/dummy/.gitignore +3 -2
  6. data/dummy/Gemfile +14 -29
  7. data/dummy/README.rdoc +15 -248
  8. data/dummy/Rakefile +0 -1
  9. data/dummy/app/assets/javascripts/application.js +2 -1
  10. data/dummy/app/controllers/application_controller.rb +3 -14
  11. data/dummy/app/views/layouts/application.html.erb +2 -6
  12. data/dummy/bin/bundle +3 -0
  13. data/dummy/bin/rails +4 -0
  14. data/dummy/bin/rake +4 -0
  15. data/dummy/config/application.rb +2 -42
  16. data/dummy/config/boot.rb +0 -2
  17. data/dummy/config/environment.rb +2 -2
  18. data/dummy/config/environments/development.rb +9 -19
  19. data/dummy/config/environments/production.rb +40 -27
  20. data/dummy/config/environments/test.rb +12 -13
  21. data/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  22. data/dummy/config/initializers/inflections.rb +6 -5
  23. data/dummy/config/initializers/omniauth.rb +8 -4
  24. data/dummy/config/initializers/secret_token.rb +6 -1
  25. data/dummy/config/initializers/session_store.rb +1 -6
  26. data/dummy/config/initializers/wrap_parameters.rb +6 -6
  27. data/dummy/config/locales/en.yml +20 -2
  28. data/dummy/config/routes.rb +15 -26
  29. data/dummy/db/migrate/{20121218124721_create_users.rb → 20130417131939_create_users.rb} +2 -2
  30. data/dummy/db/schema.rb +8 -20
  31. data/dummy/public/404.html +2 -1
  32. data/dummy/public/422.html +1 -1
  33. data/dummy/public/500.html +2 -1
  34. data/dummy/public/robots.txt +1 -1
  35. data/dummy/test/models/.keep +0 -0
  36. data/dummy/test/test_helper.rb +11 -58
  37. data/dummy/vendor/assets/javascripts/.keep +0 -0
  38. data/dummy/vendor/assets/stylesheets/.keep +0 -0
  39. data/lib/dailycred/client.rb +1 -0
  40. data/lib/dailycred/version.rb +1 -1
  41. data/lib/dailycred.rb +0 -1
  42. data/spec/helper_spec.rb +0 -2
  43. metadata +24 -44
  44. data/dummy/Guardfile +0 -31
  45. data/dummy/app/assets/javascripts/posts.js.coffee +0 -3
  46. data/dummy/app/assets/stylesheets/posts.css.scss +0 -3
  47. data/dummy/app/assets/stylesheets/scaffolds.css.scss +0 -69
  48. data/dummy/app/controllers/posts_controller.rb +0 -86
  49. data/dummy/app/helpers/posts_helper.rb +0 -2
  50. data/dummy/app/models/post.rb +0 -3
  51. data/dummy/app/views/posts/_form.html.erb +0 -21
  52. data/dummy/app/views/posts/edit.html.erb +0 -6
  53. data/dummy/app/views/posts/index.html.erb +0 -23
  54. data/dummy/app/views/posts/new.html.erb +0 -5
  55. data/dummy/app/views/posts/show.html.erb +0 -10
  56. data/dummy/db/migrate/20120926012555_create_posts.rb +0 -9
  57. data/dummy/db/migrate/20121002192037_update_users_2.rb +0 -70
  58. data/dummy/db/migrate/20121108192739_add_column_to_posts.rb +0 -5
  59. data/dummy/db/migrate/20121218205329_change_created_column.rb +0 -5
  60. data/dummy/script/rails +0 -6
  61. data/dummy/test/fixtures/posts.yml +0 -7
  62. data/dummy/test/fixtures/users.yml +0 -3
  63. data/dummy/test/functional/posts_controller_test.rb +0 -51
  64. data/dummy/test/performance/browsing_test.rb +0 -12
  65. data/dummy/test/unit/helpers/posts_helper_test.rb +0 -4
  66. data/dummy/test/unit/post_test.rb +0 -7
  67. data/dummy/test/unit/user_test.rb +0 -77
  68. data/lib/omniauth/strategies/dailycred.rb +0 -81
  69. data/spec/omniauth/strategies/dailycred_spec.rb +0 -70
  70. /data/dummy/app/{mailers/.gitkeep → controllers/concerns/.keep} +0 -0
  71. /data/dummy/app/{models/.gitkeep → mailers/.keep} +0 -0
  72. /data/dummy/{lib/assets/.gitkeep → app/models/.keep} +0 -0
  73. /data/dummy/{lib/tasks/.gitkeep → app/models/concerns/.keep} +0 -0
  74. /data/dummy/{log/.gitkeep → lib/assets/.keep} +0 -0
  75. /data/dummy/{test/fixtures/.gitkeep → lib/tasks/.keep} +0 -0
  76. /data/dummy/{test/functional/.gitkeep → log/.keep} +0 -0
  77. /data/dummy/test/{integration/.gitkeep → controllers/.keep} +0 -0
  78. /data/dummy/test/{unit/.gitkeep → fixtures/.keep} +0 -0
  79. /data/dummy/{vendor/assets/javascripts/.gitkeep → test/helpers/.keep} +0 -0
  80. /data/dummy/{vendor/assets/stylesheets/.gitkeep → test/integration/.keep} +0 -0
  81. /data/dummy/{vendor/plugins/.gitkeep → test/mailers/.keep} +0 -0
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dailycred
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hank Stoever
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-08 00:00:00.000000000 Z
11
+ date: 2013-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: omniauth
14
+ name: omniauth_dailycred
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ! '>='
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: omniauth-oauth2
28
+ name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ! '>='
@@ -75,29 +75,22 @@ files:
75
75
  - docs/lib/user/user.html
76
76
  - dummy/.gitignore
77
77
  - dummy/Gemfile
78
- - dummy/Guardfile
79
78
  - dummy/README.rdoc
80
79
  - dummy/Rakefile
81
80
  - dummy/app/assets/images/rails.png
82
81
  - dummy/app/assets/javascripts/application.js
83
- - dummy/app/assets/javascripts/posts.js.coffee
84
82
  - dummy/app/assets/stylesheets/application.css
85
- - dummy/app/assets/stylesheets/posts.css.scss
86
- - dummy/app/assets/stylesheets/scaffolds.css.scss
87
83
  - dummy/app/controllers/application_controller.rb
88
- - dummy/app/controllers/posts_controller.rb
84
+ - dummy/app/controllers/concerns/.keep
89
85
  - dummy/app/helpers/application_helper.rb
90
- - dummy/app/helpers/posts_helper.rb
91
- - dummy/app/mailers/.gitkeep
92
- - dummy/app/models/.gitkeep
93
- - dummy/app/models/post.rb
86
+ - dummy/app/mailers/.keep
87
+ - dummy/app/models/.keep
88
+ - dummy/app/models/concerns/.keep
94
89
  - dummy/app/models/user.rb
95
90
  - dummy/app/views/layouts/application.html.erb
96
- - dummy/app/views/posts/_form.html.erb
97
- - dummy/app/views/posts/edit.html.erb
98
- - dummy/app/views/posts/index.html.erb
99
- - dummy/app/views/posts/new.html.erb
100
- - dummy/app/views/posts/show.html.erb
91
+ - dummy/bin/bundle
92
+ - dummy/bin/rails
93
+ - dummy/bin/rake
101
94
  - dummy/config.ru
102
95
  - dummy/config/application.rb
103
96
  - dummy/config/boot.rb
@@ -107,6 +100,7 @@ files:
107
100
  - dummy/config/environments/production.rb
108
101
  - dummy/config/environments/test.rb
109
102
  - dummy/config/initializers/backtrace_silencers.rb
103
+ - dummy/config/initializers/filter_parameter_logging.rb
110
104
  - dummy/config/initializers/inflections.rb
111
105
  - dummy/config/initializers/mime_types.rb
112
106
  - dummy/config/initializers/omniauth.rb
@@ -115,37 +109,26 @@ files:
115
109
  - dummy/config/initializers/wrap_parameters.rb
116
110
  - dummy/config/locales/en.yml
117
111
  - dummy/config/routes.rb
118
- - dummy/db/migrate/20120926012555_create_posts.rb
119
- - dummy/db/migrate/20121002192037_update_users_2.rb
120
- - dummy/db/migrate/20121108192739_add_column_to_posts.rb
121
- - dummy/db/migrate/20121218124721_create_users.rb
122
- - dummy/db/migrate/20121218205329_change_created_column.rb
112
+ - dummy/db/migrate/20130417131939_create_users.rb
123
113
  - dummy/db/schema.rb
124
114
  - dummy/db/seeds.rb
125
- - dummy/lib/assets/.gitkeep
126
- - dummy/lib/tasks/.gitkeep
127
- - dummy/log/.gitkeep
115
+ - dummy/lib/assets/.keep
116
+ - dummy/lib/tasks/.keep
117
+ - dummy/log/.keep
128
118
  - dummy/public/404.html
129
119
  - dummy/public/422.html
130
120
  - dummy/public/500.html
131
121
  - dummy/public/favicon.ico
132
122
  - dummy/public/robots.txt
133
- - dummy/script/rails
134
- - dummy/test/fixtures/.gitkeep
135
- - dummy/test/fixtures/posts.yml
136
- - dummy/test/fixtures/users.yml
137
- - dummy/test/functional/.gitkeep
138
- - dummy/test/functional/posts_controller_test.rb
139
- - dummy/test/integration/.gitkeep
140
- - dummy/test/performance/browsing_test.rb
123
+ - dummy/test/controllers/.keep
124
+ - dummy/test/fixtures/.keep
125
+ - dummy/test/helpers/.keep
126
+ - dummy/test/integration/.keep
127
+ - dummy/test/mailers/.keep
128
+ - dummy/test/models/.keep
141
129
  - dummy/test/test_helper.rb
142
- - dummy/test/unit/.gitkeep
143
- - dummy/test/unit/helpers/posts_helper_test.rb
144
- - dummy/test/unit/post_test.rb
145
- - dummy/test/unit/user_test.rb
146
- - dummy/vendor/assets/javascripts/.gitkeep
147
- - dummy/vendor/assets/stylesheets/.gitkeep
148
- - dummy/vendor/plugins/.gitkeep
130
+ - dummy/vendor/assets/javascripts/.keep
131
+ - dummy/vendor/assets/stylesheets/.keep
149
132
  - lib/dailycred.rb
150
133
  - lib/dailycred/acts_as_dailycred.rb
151
134
  - lib/dailycred/client.rb
@@ -163,10 +146,8 @@ files:
163
146
  - lib/generators/templates/omniauth.rb
164
147
  - lib/generators/templates/sessions_controller.rb
165
148
  - lib/generators/templates/user.rb
166
- - lib/omniauth/strategies/dailycred.rb
167
149
  - script/download_info.rb
168
150
  - spec/helper_spec.rb
169
- - spec/omniauth/strategies/dailycred_spec.rb
170
151
  - spec/support/dailycred_spec.rb
171
152
  - spec/support/shared_examples.rb
172
153
  - test/generator_test.rb
@@ -196,7 +177,6 @@ specification_version: 4
196
177
  summary: ''
197
178
  test_files:
198
179
  - spec/helper_spec.rb
199
- - spec/omniauth/strategies/dailycred_spec.rb
200
180
  - spec/support/dailycred_spec.rb
201
181
  - spec/support/shared_examples.rb
202
182
  - test/generator_test.rb
data/dummy/Guardfile DELETED
@@ -1,31 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- guard :test do
5
- watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
6
- watch(%r{^test/.+_test\.rb$})
7
- watch('test/test_helper.rb') { "test" }
8
- watch(%r{/test\/unit\/(.+)_test.rb/})
9
- watch('../lib/dailycred/acts_as_dailycred.rb') { "test/unit/user_test.rb"}
10
- Dir[File.expand_path('../../lib/dailycred/*.rb', __FILE__)].each do |f|
11
- watch(f) {"test/unit/user_test.rb"}
12
- end
13
-
14
- # Rails example
15
- watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
16
- watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
17
- watch(%r{^app/views/.+\.rb$}) { "test/integration" }
18
- watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] }
19
- end
20
-
21
- guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
22
- watch('config/application.rb')
23
- watch('config/environment.rb')
24
- watch('config/environments/test.rb')
25
- watch(%r{^config/initializers/.+\.rb$})
26
- watch('Gemfile')
27
- watch('Gemfile.lock')
28
- watch('spec/spec_helper.rb') { :rspec }
29
- watch('test/test_helper.rb') { :test_unit }
30
- watch(%r{features/support/}) { :cucumber }
31
- end
@@ -1,3 +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.
3
- # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the posts controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,69 +0,0 @@
1
- body {
2
- background-color: #fff;
3
- color: #333;
4
- font-family: verdana, arial, helvetica, sans-serif;
5
- font-size: 13px;
6
- line-height: 18px;
7
- }
8
-
9
- p, ol, ul, td {
10
- font-family: verdana, arial, helvetica, sans-serif;
11
- font-size: 13px;
12
- line-height: 18px;
13
- }
14
-
15
- pre {
16
- background-color: #eee;
17
- padding: 10px;
18
- font-size: 11px;
19
- }
20
-
21
- a {
22
- color: #000;
23
- &:visited {
24
- color: #666;
25
- }
26
- &:hover {
27
- color: #fff;
28
- background-color: #000;
29
- }
30
- }
31
-
32
- div {
33
- &.field, &.actions {
34
- margin-bottom: 10px;
35
- }
36
- }
37
-
38
- #notice {
39
- color: green;
40
- }
41
-
42
- .field_with_errors {
43
- padding: 2px;
44
- background-color: red;
45
- display: table;
46
- }
47
-
48
- #error_explanation {
49
- width: 450px;
50
- border: 2px solid red;
51
- padding: 7px;
52
- padding-bottom: 0;
53
- margin-bottom: 20px;
54
- background-color: #f0f0f0;
55
- h2 {
56
- text-align: left;
57
- font-weight: bold;
58
- padding: 5px 5px 5px 15px;
59
- font-size: 12px;
60
- margin: -7px;
61
- margin-bottom: 0px;
62
- background-color: #c00;
63
- color: #fff;
64
- }
65
- ul li {
66
- font-size: 12px;
67
- list-style: square;
68
- }
69
- }
@@ -1,86 +0,0 @@
1
- class PostsController < ApplicationController
2
- before_filter :authenticate
3
- # GET /posts
4
- # GET /posts.json
5
-
6
- def index
7
- @posts = Post.all
8
- ap current_user.created.utc
9
-
10
- respond_to do |format|
11
- format.html # index.html.erb
12
- format.json { render json: @posts }
13
- end
14
- end
15
-
16
- # GET /posts/1
17
- # GET /posts/1.json
18
- def show
19
- @post = Post.find(params[:id])
20
-
21
- respond_to do |format|
22
- format.html # show.html.erb
23
- format.json { render json: @post }
24
- end
25
- end
26
-
27
- # GET /posts/new
28
- # GET /posts/new.json
29
- def new
30
- @post = Post.new
31
-
32
- respond_to do |format|
33
- format.html # new.html.erb
34
- format.json { render json: @post }
35
- end
36
- end
37
-
38
- # GET /posts/1/edit
39
- def edit
40
- @post = Post.find(params[:id])
41
- end
42
-
43
- # POST /posts
44
- # POST /posts.json
45
- def create
46
- @post = Post.new(params[:post])
47
-
48
- respond_to do |format|
49
- if @post.save
50
- format.html { redirect_to @post, notice: 'Post was successfully created.' }
51
- format.json { render json: @post, status: :created, location: @post }
52
- else
53
- format.html { render action: "new" }
54
- format.json { render json: @post.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # PUT /posts/1
60
- # PUT /posts/1.json
61
- def update
62
- @post = Post.find(params[:id])
63
-
64
- respond_to do |format|
65
- if @post.update_attributes(params[:post])
66
- format.html { redirect_to @post, notice: 'Post was successfully updated.' }
67
- format.json { head :no_content }
68
- else
69
- format.html { render action: "edit" }
70
- format.json { render json: @post.errors, status: :unprocessable_entity }
71
- end
72
- end
73
- end
74
-
75
- # DELETE /posts/1
76
- # DELETE /posts/1.json
77
- def destroy
78
- @post = Post.find(params[:id])
79
- @post.destroy
80
-
81
- respond_to do |format|
82
- format.html { redirect_to posts_url }
83
- format.json { head :no_content }
84
- end
85
- end
86
- end
@@ -1,2 +0,0 @@
1
- module PostsHelper
2
- end
@@ -1,3 +0,0 @@
1
- class Post < ActiveRecord::Base
2
- attr_accessible :title
3
- end
@@ -1,21 +0,0 @@
1
- <%= form_for(@post) do |f| %>
2
- <% if @post.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
5
-
6
- <ul>
7
- <% @post.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="actions">
19
- <%= f.submit %>
20
- </div>
21
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing post</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @post %> |
6
- <%= link_to 'Back', posts_path %>
@@ -1,23 +0,0 @@
1
- <h1>Listing posts</h1>
2
-
3
- <table>
4
- <tr>
5
- <th>Title</th>
6
- <th></th>
7
- <th></th>
8
- <th></th>
9
- </tr>
10
-
11
- <% @posts.each do |post| %>
12
- <tr>
13
- <td><%= post.title %></td>
14
- <td><%= link_to 'Show', post %></td>
15
- <td><%= link_to 'Edit', edit_post_path(post) %></td>
16
- <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
17
- </tr>
18
- <% end %>
19
- </table>
20
-
21
- <br />
22
-
23
- <%= link_to 'New Post', new_post_path %>
@@ -1,5 +0,0 @@
1
- <h1>New post</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', posts_path %>
@@ -1,10 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <b>Title:</b>
5
- <%= @post.title %>
6
- </p>
7
-
8
-
9
- <%= link_to 'Edit', edit_post_path(@post) %> |
10
- <%= link_to 'Back', posts_path %>
@@ -1,9 +0,0 @@
1
- class CreatePosts < ActiveRecord::Migration
2
- def change
3
- create_table :posts do |t|
4
- t.string :title
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,70 +0,0 @@
1
- class UpdateUsers2 < ActiveRecord::Migration
2
- def self.up
3
- if !table_exists? :users
4
- create_table :users do |t|
5
- t.string :provider
6
- t.string :uid
7
- t.string :email
8
- t.integer :created
9
- t.string :username
10
- t.boolean :verified
11
- t.boolean :admin
12
- t.string :referred_by
13
- t.string :token
14
- t.text :facebook
15
- t.text :tags
16
- t.text :referred
17
- t.text :google
18
- t.text :twitter
19
- t.text :github
20
- t.text :access_tokens
21
- t.boolean :subscribed
22
- t.string :display
23
-
24
- t.timestamps
25
- end
26
- else
27
- safe_column :users, :provider, :string
28
- safe_column :users, :uid, :string
29
- safe_column :users, :email, :string
30
- safe_column :users, :created, :integer
31
- safe_column :users, :username, :string
32
- safe_column :users, :verified, :booleanied
33
- safe_column :users, :admin, :boolean
34
- safe_column :users, :referred, :string
35
- safe_column :users, :token, :string
36
- safe_column :users, :facebook, :text
37
- safe_column :users, :tags, :text
38
- safe_column :users, :referred, :text
39
- safe_column :users, :google, :text
40
- safe_column :users, :twitter, :text
41
- safe_column :users, :github, :text
42
- safe_column :users, :access_tokens, :text
43
- safe_column :users, :display, :string
44
- safe_column :users, :subscribed, :boolean
45
- end
46
- end
47
-
48
- def self.down
49
- drop_table :users
50
- end
51
-
52
- private
53
-
54
- def table_exists? table
55
- ActiveRecord::Base.connection.table_exists?(table.to_s)
56
- end
57
-
58
- def column_exists?(table, column)
59
- begin
60
- ActiveRecord::Base.connection.columns(table.to_s).map(&:name).include?(column.to_s)
61
- rescue NoMethodError #actual_columns is empty and it doesn't respond to the map method
62
- false
63
- end
64
- end
65
-
66
- def safe_column table, name, type
67
- add_column table.to_sym, name.to_sym, type.to_sym unless column_exists? table, name
68
- end
69
-
70
- end
@@ -1,5 +0,0 @@
1
- class AddColumnToPosts < ActiveRecord::Migration
2
- def change
3
- add_column :posts, :created, :timestamp
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class ChangeCreatedColumn < ActiveRecord::Migration
2
- def change
3
- change_column :users, :created, :datetime
4
- end
5
- end
data/dummy/script/rails DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,7 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
-
3
- one:
4
- title: MyString
5
-
6
- two:
7
- title: MyString
@@ -1,3 +0,0 @@
1
- basic:
2
- uid: 89c93c0a-5999-4b80-811b-c66a3240651b
3
- email: dummy@dailycred.com
@@ -1,51 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PostsControllerTest < ActionController::TestCase
4
- setup do
5
- @post = posts(:one)
6
- @user = users(:basic)
7
- @controller.stubs(:current_user).returns(@user)
8
- end
9
-
10
- test "should get index" do
11
- get :index
12
- assert_response :success
13
- assert_not_nil assigns(:posts)
14
- end
15
-
16
- test "should get new" do
17
- get :new
18
- assert_response :success
19
- end
20
-
21
- test "should create post" do
22
- assert_difference('Post.count') do
23
- post :create, post: { title: @post.title }
24
- end
25
-
26
- assert_redirected_to post_path(assigns(:post))
27
- end
28
-
29
- test "should show post" do
30
- get :show, id: @post
31
- assert_response :success
32
- end
33
-
34
- test "should get edit" do
35
- get :edit, id: @post
36
- assert_response :success
37
- end
38
-
39
- test "should update post" do
40
- put :update, id: @post, post: { title: @post.title }
41
- assert_redirected_to post_path(assigns(:post))
42
- end
43
-
44
- test "should destroy post" do
45
- assert_difference('Post.count', -1) do
46
- delete :destroy, id: @post
47
- end
48
-
49
- assert_redirected_to posts_path
50
- end
51
- end
@@ -1,12 +0,0 @@
1
- require 'test_helper'
2
- require 'rails/performance_test_help'
3
-
4
- class BrowsingTest < ActionDispatch::PerformanceTest
5
- # Refer to the documentation for all available options
6
- # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
7
- # :output => 'tmp/performance', :formats => [:flat] }
8
-
9
- def test_homepage
10
- get '/'
11
- end
12
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PostsHelperTest < ActionView::TestCase
4
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class PostTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end