raygun 0.0.34 → 0.9.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGES.md +7 -1
  4. data/README.md +7 -11
  5. data/bin/raygun +4 -181
  6. data/cleanup.sh +1 -6
  7. data/lib/raygun/raygun.rb +238 -0
  8. data/lib/raygun/version.rb +1 -1
  9. metadata +6 -223
  10. data/TODO.md +0 -16
  11. data/rails_32/.env +0 -8
  12. data/rails_32/.gitignore +0 -19
  13. data/rails_32/.rspec +0 -1
  14. data/rails_32/.ruby-gemset +0 -1
  15. data/rails_32/.ruby-version +0 -1
  16. data/rails_32/Gemfile +0 -54
  17. data/rails_32/Guardfile +0 -32
  18. data/rails_32/Procfile +0 -2
  19. data/rails_32/README.md +0 -69
  20. data/rails_32/Rakefile +0 -15
  21. data/rails_32/app/assets/javascripts/application.js +0 -16
  22. data/rails_32/app/assets/javascripts/users.js.coffee +0 -3
  23. data/rails_32/app/assets/stylesheets/_footer.less +0 -30
  24. data/rails_32/app/assets/stylesheets/_navbar.less +0 -5
  25. data/rails_32/app/assets/stylesheets/application.css.less +0 -3
  26. data/rails_32/app/controllers/application_controller.rb +0 -15
  27. data/rails_32/app/controllers/pages_controller.rb +0 -8
  28. data/rails_32/app/controllers/password_resets_controller.rb +0 -36
  29. data/rails_32/app/controllers/registrations_controller.rb +0 -29
  30. data/rails_32/app/controllers/user_sessions_controller.rb +0 -26
  31. data/rails_32/app/controllers/users_controller.rb +0 -41
  32. data/rails_32/app/helpers/application_helper.rb +0 -11
  33. data/rails_32/app/helpers/users_helper.rb +0 -2
  34. data/rails_32/app/mailers/.gitkeep +0 -0
  35. data/rails_32/app/mailers/user_mailer.rb +0 -19
  36. data/rails_32/app/models/.gitkeep +0 -0
  37. data/rails_32/app/models/ability.rb +0 -40
  38. data/rails_32/app/models/user.rb +0 -21
  39. data/rails_32/app/models/user_session.rb +0 -6
  40. data/rails_32/app/views/layouts/application.html.slim +0 -36
  41. data/rails_32/app/views/pages/root.html.slim +0 -9
  42. data/rails_32/app/views/password_resets/edit.html.slim +0 -15
  43. data/rails_32/app/views/password_resets/new.html.slim +0 -11
  44. data/rails_32/app/views/registrations/new.html.slim +0 -13
  45. data/rails_32/app/views/user_mailer/activation_needed_email.html.erb +0 -17
  46. data/rails_32/app/views/user_mailer/activation_needed_email.text.erb +0 -9
  47. data/rails_32/app/views/user_mailer/activation_success_email.html.erb +0 -17
  48. data/rails_32/app/views/user_mailer/activation_success_email.text.erb +0 -9
  49. data/rails_32/app/views/user_mailer/reset_password_email.html.erb +0 -16
  50. data/rails_32/app/views/user_mailer/reset_password_email.text.erb +0 -8
  51. data/rails_32/app/views/user_sessions/new.html.slim +0 -13
  52. data/rails_32/app/views/users/_form.html.slim +0 -12
  53. data/rails_32/app/views/users/edit.html.slim +0 -5
  54. data/rails_32/app/views/users/index.html.slim +0 -26
  55. data/rails_32/app/views/users/new.html.slim +0 -4
  56. data/rails_32/app/views/users/show.html.slim +0 -17
  57. data/rails_32/config/application.rb +0 -77
  58. data/rails_32/config/boot.rb +0 -6
  59. data/rails_32/config/database.yml +0 -13
  60. data/rails_32/config/environment.rb +0 -5
  61. data/rails_32/config/environments/acceptance.rb +0 -69
  62. data/rails_32/config/environments/development.rb +0 -39
  63. data/rails_32/config/environments/production.rb +0 -69
  64. data/rails_32/config/environments/test.rb +0 -42
  65. data/rails_32/config/initializers/backtrace_silencers.rb +0 -7
  66. data/rails_32/config/initializers/inflections.rb +0 -15
  67. data/rails_32/config/initializers/mailcatcher.rb +0 -15
  68. data/rails_32/config/initializers/mime_types.rb +0 -5
  69. data/rails_32/config/initializers/secret_token.rb +0 -7
  70. data/rails_32/config/initializers/session_store.rb +0 -8
  71. data/rails_32/config/initializers/simple_form.rb +0 -142
  72. data/rails_32/config/initializers/simple_form_bootstrap.rb +0 -45
  73. data/rails_32/config/initializers/sorcery.rb +0 -398
  74. data/rails_32/config/initializers/wrap_parameters.rb +0 -14
  75. data/rails_32/config/locales/en.yml +0 -5
  76. data/rails_32/config/locales/simple_form.en.yml +0 -26
  77. data/rails_32/config/routes.rb +0 -21
  78. data/rails_32/config/unicorn.rb +0 -27
  79. data/rails_32/config.ru +0 -21
  80. data/rails_32/db/migrate/20121128215324_sorcery_core.rb +0 -19
  81. data/rails_32/db/migrate/20121128215325_sorcery_brute_force_protection.rb +0 -13
  82. data/rails_32/db/migrate/20121128215326_sorcery_activity_logging.rb +0 -17
  83. data/rails_32/db/migrate/20121128215327_sorcery_user_activation.rb +0 -17
  84. data/rails_32/db/migrate/20121128215328_sorcery_remember_me.rb +0 -15
  85. data/rails_32/db/migrate/20121128215329_sorcery_reset_password.rb +0 -17
  86. data/rails_32/db/migrate/20121128215330_sorcery_external.rb +0 -14
  87. data/rails_32/db/migrate/20121128215337_add_admin_to_users.rb +0 -5
  88. data/rails_32/db/sample_data.rb +0 -24
  89. data/rails_32/db/schema.rb +0 -54
  90. data/rails_32/db/seeds.rb +0 -7
  91. data/rails_32/lib/assets/.gitkeep +0 -0
  92. data/rails_32/lib/tasks/.gitkeep +0 -0
  93. data/rails_32/lib/tasks/cane.rake +0 -30
  94. data/rails_32/lib/tasks/coverage.rake +0 -10
  95. data/rails_32/lib/tasks/db.rake +0 -7
  96. data/rails_32/lib/tasks/spec.rake +0 -35
  97. data/rails_32/lib/templates/rails/scaffold_controller/controller.rb +0 -45
  98. data/rails_32/lib/templates/rspec/scaffold/controller_spec.rb +0 -155
  99. data/rails_32/lib/templates/rspec/scaffold/edit_spec.rb +0 -18
  100. data/rails_32/lib/templates/rspec/scaffold/index_spec.rb +0 -26
  101. data/rails_32/lib/templates/rspec/scaffold/new_spec.rb +0 -18
  102. data/rails_32/lib/templates/rspec/scaffold/show_spec.rb +0 -16
  103. data/rails_32/lib/templates/slim/scaffold/_form.html.slim +0 -13
  104. data/rails_32/lib/templates/slim/scaffold/edit.html.slim +0 -5
  105. data/rails_32/lib/templates/slim/scaffold/index.html.slim +0 -28
  106. data/rails_32/lib/templates/slim/scaffold/new.html.slim +0 -4
  107. data/rails_32/lib/templates/slim/scaffold/show.html.slim +0 -17
  108. data/rails_32/log/.gitkeep +0 -0
  109. data/rails_32/public/404.html +0 -26
  110. data/rails_32/public/422.html +0 -26
  111. data/rails_32/public/500.html +0 -25
  112. data/rails_32/public/favicon.ico +0 -0
  113. data/rails_32/public/robots.txt +0 -5
  114. data/rails_32/script/rails +0 -6
  115. data/rails_32/spec/controllers/user_sessions_controller_spec.rb +0 -42
  116. data/rails_32/spec/controllers/users_controller_spec.rb +0 -150
  117. data/rails_32/spec/factories/users.rb +0 -14
  118. data/rails_32/spec/features/activation_spec.rb +0 -18
  119. data/rails_32/spec/features/password_reset_spec.rb +0 -41
  120. data/rails_32/spec/features/registration_spec.rb +0 -39
  121. data/rails_32/spec/features/sign_in_spec.rb +0 -30
  122. data/rails_32/spec/javascripts/example_spec.js.coffee +0 -20
  123. data/rails_32/spec/javascripts/spec.css +0 -3
  124. data/rails_32/spec/javascripts/spec.js.coffee +0 -2
  125. data/rails_32/spec/mailers/user_mailer_spec.rb +0 -48
  126. data/rails_32/spec/models/ability_spec.rb +0 -38
  127. data/rails_32/spec/models/user_spec.rb +0 -36
  128. data/rails_32/spec/spec_helper.rb +0 -64
  129. data/rails_32/spec/support/accept_values.rb +0 -55
  130. data/rails_32/spec/support/database_cleaner.rb +0 -24
  131. data/rails_32/spec/support/factory_girl.rb +0 -3
  132. data/rails_32/spec/support/sorcery.rb +0 -3
  133. data/rails_32/spec/support/user_sessions_feature_helper.rb +0 -21
  134. data/rails_32/spec/views/users/edit.html.slim_spec.rb +0 -16
  135. data/rails_32/spec/views/users/index.html.slim_spec.rb +0 -16
  136. data/rails_32/spec/views/users/new.html.slim_spec.rb +0 -16
  137. data/rails_32/spec/views/users/show.html.slim_spec.rb +0 -13
  138. data/rails_32/vendor/assets/javascripts/.gitkeep +0 -0
  139. data/rails_32/vendor/assets/stylesheets/.gitkeep +0 -0
  140. data/rails_32/vendor/plugins/.gitkeep +0 -0
  141. data/rails_40/.env +0 -8
  142. data/rails_40/.gitignore +0 -16
  143. data/rails_40/.rspec +0 -1
  144. data/rails_40/.ruby-gemset +0 -1
  145. data/rails_40/.ruby-version +0 -1
  146. data/rails_40/Gemfile +0 -53
  147. data/rails_40/Guardfile +0 -34
  148. data/rails_40/Procfile +0 -2
  149. data/rails_40/README.md +0 -90
  150. data/rails_40/Rakefile +0 -15
  151. data/rails_40/app/assets/javascripts/application.js +0 -17
  152. data/rails_40/app/assets/stylesheets/_footer.less +0 -30
  153. data/rails_40/app/assets/stylesheets/_navbar.less +0 -3
  154. data/rails_40/app/assets/stylesheets/application.css.less +0 -3
  155. data/rails_40/app/controllers/application_controller.rb +0 -5
  156. data/rails_40/app/controllers/concerns/.keep +0 -0
  157. data/rails_40/app/controllers/pages_controller.rb +0 -6
  158. data/rails_40/app/helpers/application_helper.rb +0 -11
  159. data/rails_40/app/mailers/.keep +0 -0
  160. data/rails_40/app/models/.keep +0 -0
  161. data/rails_40/app/models/concerns/.keep +0 -0
  162. data/rails_40/app/views/layouts/application.html.slim +0 -39
  163. data/rails_40/app/views/pages/root.html.slim +0 -13
  164. data/rails_40/bin/bundle +0 -3
  165. data/rails_40/bin/deploy.sh +0 -47
  166. data/rails_40/bin/rails +0 -4
  167. data/rails_40/bin/rake +0 -4
  168. data/rails_40/circle.yml +0 -16
  169. data/rails_40/config/application.rb +0 -36
  170. data/rails_40/config/boot.rb +0 -4
  171. data/rails_40/config/database.yml +0 -15
  172. data/rails_40/config/environment.rb +0 -5
  173. data/rails_40/config/environments/acceptance.rb +0 -8
  174. data/rails_40/config/environments/development.rb +0 -31
  175. data/rails_40/config/environments/production.rb +0 -82
  176. data/rails_40/config/environments/test.rb +0 -38
  177. data/rails_40/config/initializers/backtrace_silencers.rb +0 -7
  178. data/rails_40/config/initializers/filter_parameter_logging.rb +0 -4
  179. data/rails_40/config/initializers/inflections.rb +0 -16
  180. data/rails_40/config/initializers/mailcatcher.rb +0 -15
  181. data/rails_40/config/initializers/mime_types.rb +0 -5
  182. data/rails_40/config/initializers/secret_token.rb +0 -12
  183. data/rails_40/config/initializers/session_store.rb +0 -3
  184. data/rails_40/config/initializers/simple_form.rb +0 -142
  185. data/rails_40/config/initializers/simple_form_bootstrap.rb +0 -45
  186. data/rails_40/config/initializers/wrap_parameters.rb +0 -14
  187. data/rails_40/config/locales/en.yml +0 -23
  188. data/rails_40/config/locales/simple_form.en.yml +0 -26
  189. data/rails_40/config/routes.rb +0 -5
  190. data/rails_40/config/unicorn.rb +0 -27
  191. data/rails_40/config.ru +0 -18
  192. data/rails_40/db/sample_data.rb +0 -11
  193. data/rails_40/db/schema.rb +0 -19
  194. data/rails_40/db/seeds.rb +0 -7
  195. data/rails_40/lib/assets/.keep +0 -0
  196. data/rails_40/lib/tasks/.keep +0 -0
  197. data/rails_40/lib/tasks/coverage.rake +0 -10
  198. data/rails_40/lib/tasks/db.rake +0 -7
  199. data/rails_40/lib/tasks/spec.rake +0 -60
  200. data/rails_40/lib/templates/rails/scaffold_controller/controller.rb +0 -61
  201. data/rails_40/lib/templates/rspec/controller/controller_spec.rb +0 -16
  202. data/rails_40/lib/templates/rspec/scaffold/controller_spec.rb +0 -155
  203. data/rails_40/lib/templates/rspec/scaffold/edit_spec.rb +0 -18
  204. data/rails_40/lib/templates/rspec/scaffold/index_spec.rb +0 -26
  205. data/rails_40/lib/templates/rspec/scaffold/new_spec.rb +0 -19
  206. data/rails_40/lib/templates/rspec/scaffold/show_spec.rb +0 -16
  207. data/rails_40/lib/templates/slim/scaffold/_form.html.slim +0 -13
  208. data/rails_40/lib/templates/slim/scaffold/edit.html.slim +0 -5
  209. data/rails_40/lib/templates/slim/scaffold/index.html.slim +0 -29
  210. data/rails_40/lib/templates/slim/scaffold/new.html.slim +0 -4
  211. data/rails_40/lib/templates/slim/scaffold/show.html.slim +0 -17
  212. data/rails_40/log/.keep +0 -0
  213. data/rails_40/public/404.html +0 -58
  214. data/rails_40/public/422.html +0 -58
  215. data/rails_40/public/500.html +0 -57
  216. data/rails_40/public/favicon.ico +0 -0
  217. data/rails_40/public/robots.txt +0 -5
  218. data/rails_40/spec/controllers/pages_controller_spec.rb +0 -12
  219. data/rails_40/spec/features/pages_spec.rb +0 -18
  220. data/rails_40/spec/javascripts/example_spec.js.coffee +0 -20
  221. data/rails_40/spec/javascripts/spec.css +0 -3
  222. data/rails_40/spec/javascripts/spec.js.coffee +0 -2
  223. data/rails_40/spec/spec_helper.rb +0 -79
  224. data/rails_40/spec/support/database_cleaner.rb +0 -24
  225. data/rails_40/spec/support/factory_girl.rb +0 -3
  226. data/rails_40/vendor/assets/javascripts/.keep +0 -0
  227. data/rails_40/vendor/assets/stylesheets/.keep +0 -0
@@ -1,54 +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 => 20121128215337) do
15
-
16
- create_table "authentications", :force => true do |t|
17
- t.integer "user_id", :null => false
18
- t.string "provider", :null => false
19
- t.string "uid", :null => false
20
- t.datetime "created_at", :null => false
21
- t.datetime "updated_at", :null => false
22
- end
23
-
24
- create_table "users", :force => true do |t|
25
- t.string "name"
26
- t.string "email"
27
- t.string "crypted_password"
28
- t.string "salt"
29
- t.datetime "created_at", :null => false
30
- t.datetime "updated_at", :null => false
31
- t.integer "failed_logins_count", :default => 0
32
- t.datetime "lock_expires_at"
33
- t.string "unlock_token"
34
- t.datetime "last_login_at"
35
- t.datetime "last_logout_at"
36
- t.datetime "last_activity_at"
37
- t.string "activation_state"
38
- t.string "activation_token"
39
- t.datetime "activation_token_expires_at"
40
- t.string "remember_me_token"
41
- t.datetime "remember_me_token_expires_at"
42
- t.string "reset_password_token"
43
- t.datetime "reset_password_token_expires_at"
44
- t.datetime "reset_password_email_sent_at"
45
- t.boolean "admin"
46
- end
47
-
48
- add_index "users", ["activation_token"], :name => "index_users_on_activation_token"
49
- add_index "users", ["email"], :name => "index_users_on_email", :unique => true
50
- add_index "users", ["last_logout_at", "last_activity_at"], :name => "index_users_on_last_logout_at_and_last_activity_at"
51
- add_index "users", ["remember_me_token"], :name => "index_users_on_remember_me_token"
52
- add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token"
53
-
54
- end
data/rails_32/db/seeds.rb DELETED
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
- # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
@@ -1,30 +0,0 @@
1
- begin
2
- require 'cane/rake_task'
3
- require 'morecane'
4
-
5
- desc "Run cane to check quality metrics"
6
- Cane::RakeTask.new(:quality) do |cane|
7
- cane.add_threshold 'coverage/covered_percent', :>=, 95
8
-
9
- cane.no_style = false # Change to true to skip style checks
10
- cane.style_measure = 120 # Maximum line length
11
- cane.style_exclude = %w{
12
- lib/templates/rspec/scaffold/controller_spec.rb
13
- }
14
-
15
- cane.no_doc = true # Change to false to enable documentation checks
16
-
17
- cane.abc_max = 15 # Fail the build if complexity is too high.
18
- # cane.abc_exclude = %w(
19
- # User#bad_code_rising
20
- # )
21
-
22
- # Fail the build if the code includes debugging statements
23
- cane.use Morecane::MustNotMatchCheck,
24
- must_not_match_glob: "{app,lib,config,spec}/**/*.rb",
25
- must_not_match_regexp: /binding\.pry|debugger/
26
- end
27
-
28
- rescue LoadError
29
- warn "cane not available, quality task not provided."
30
- end
@@ -1,10 +0,0 @@
1
- namespace :spec do
2
- task :enable_coverage do
3
- ENV['COVERAGE'] = '1'
4
- end
5
-
6
- desc "Executes specs with code coverage reports"
7
- task coverage: :enable_coverage do
8
- Rake::Task[:spec].invoke
9
- end
10
- end
@@ -1,7 +0,0 @@
1
- namespace :db do
2
- desc "Load a small, representative set of data so that the application can start in an use state (for development)."
3
- task sample_data: :environment do
4
- sample_data = File.join(Rails.root, 'db', 'sample_data.rb')
5
- load(sample_data) if sample_data
6
- end
7
- end
@@ -1,35 +0,0 @@
1
- begin
2
- require 'guard/jasmine/task'
3
-
4
- namespace :spec do
5
- desc "Run all javascript specs"
6
- task :javascripts do
7
- begin
8
- ::Guard::Jasmine::CLI.start([])
9
-
10
- rescue SystemExit => e
11
- case e.status
12
- when 1
13
- fail "Some specs have failed."
14
- when 2
15
- fail "The spec couldn't be run: #{e.message}."
16
- end
17
- end
18
- end
19
-
20
- desc 'Runs specs with coverage and cane checks'
21
- task cane: ['spec:enable_coverage', 'spec:coverage', 'quality']
22
- end
23
-
24
- Rake::Task['spec'].enhance do
25
- Rake::Task['spec:javascripts'].invoke
26
- end
27
-
28
- rescue LoadError
29
- namespace :spec do
30
- task :javascripts do
31
- puts "Guard is not available in this environment: #{Rails.env}."
32
- end
33
- end
34
- end
35
-
@@ -1,45 +0,0 @@
1
- <% if namespaced? -%>
2
- require_dependency "<%= namespaced_file_path %>/application_controller"
3
-
4
- <% end -%>
5
- <% module_namespacing do -%>
6
- class <%= controller_class_name %>Controller < ApplicationController
7
-
8
- load_and_authorize_resource
9
-
10
- def index
11
- end
12
-
13
- def show
14
- end
15
-
16
- def new
17
- end
18
-
19
- def edit
20
- end
21
-
22
- def create
23
- @<%= singular_table_name %> = <%= orm_class.build(class_name, "params[:#{singular_table_name}]") %>
24
-
25
- if @<%= orm_instance.save %>
26
- redirect_to @<%= singular_table_name %>, <%= key_value :notice, "'#{human_name} was successfully created.'" %>
27
- else
28
- render <%= key_value :action, '"new"' %>
29
- end
30
- end
31
-
32
- def update
33
- if @<%= orm_instance.update_attributes("params[:#{singular_table_name}]") %>
34
- redirect_to @<%= singular_table_name %>, <%= key_value :notice, "'#{human_name} was successfully updated.'" %>
35
- else
36
- render <%= key_value :action, '"edit"' %>
37
- end
38
- end
39
-
40
- def destroy
41
- @<%= orm_instance.destroy %>
42
- redirect_to <%= index_helper %>_url
43
- end
44
- end
45
- <% end -%>
@@ -1,155 +0,0 @@
1
- require 'spec_helper'
2
-
3
- <% module_namespacing do -%>
4
- describe <%= controller_class_name %>Controller do
5
-
6
- # This should return the minimal set of attributes required to create a valid
7
- # <%= class_name %>. As you add validations to <%= class_name %>, be sure to
8
- # update the return value of this method accordingly.
9
- def valid_attributes
10
- attributes_for :<%= file_name %>
11
- end
12
-
13
- # This should return the minimal set of values that should be in the session
14
- # in order to pass any filters (e.g. authentication) defined in
15
- # <%= controller_class_name %>Controller. Be sure to keep this updated too.
16
- def valid_session
17
- {}
18
- end
19
-
20
- before do
21
- # TODO Set to :user and specify authorization rules in Ability.rb.
22
- login_user build :admin
23
- end
24
-
25
- <% unless options[:singleton] -%>
26
- describe "#index" do
27
- it "assigns all <%= table_name.pluralize %> as @<%= table_name.pluralize %>" do
28
- <%= file_name %> = <%= class_name %>.create! valid_attributes
29
- get :index, {}, valid_session
30
- expect(assigns(:<%= table_name %>)).to eq([<%= file_name %>])
31
- end
32
- end
33
-
34
- <% end -%>
35
- describe "#show" do
36
- it "assigns the requested <%= ns_file_name %> as @<%= ns_file_name %>" do
37
- <%= file_name %> = <%= class_name %>.create! valid_attributes
38
- get :show, { :id => <%= file_name %>.to_param }, valid_session
39
- expect(assigns(:<%= ns_file_name %>)).to eq(<%= file_name %>)
40
- end
41
- end
42
-
43
- describe "#new" do
44
- it "assigns a new <%= ns_file_name %> as @<%= ns_file_name %>" do
45
- get :new, {}, valid_session
46
- expect(assigns(:<%= ns_file_name %>)).to be_a_new(<%= class_name %>)
47
- end
48
- end
49
-
50
- describe "#edit" do
51
- it "assigns the requested <%= ns_file_name %> as @<%= ns_file_name %>" do
52
- <%= file_name %> = <%= class_name %>.create! valid_attributes
53
- get :edit, { :id => <%= file_name %>.to_param }, valid_session
54
- expect(assigns(:<%= ns_file_name %>)).to eq(<%= file_name %>)
55
- end
56
- end
57
-
58
- describe "#create" do
59
- describe "with valid params" do
60
- it "creates a new <%= class_name %>" do
61
- expect {
62
- post :create, { :<%= ns_file_name %> => valid_attributes }, valid_session
63
- }.to change(<%= class_name %>, :count).by(1)
64
- end
65
-
66
- it "assigns a newly created <%= ns_file_name %> as @<%= ns_file_name %>" do
67
- post :create, {:<%= ns_file_name %> => valid_attributes }, valid_session
68
- expect(assigns(:<%= ns_file_name %>)).to be_a(<%= class_name %>)
69
- expect(assigns(:<%= ns_file_name %>)).to be_persisted
70
- end
71
-
72
- it "redirects to the created <%= ns_file_name %>" do
73
- post :create, { :<%= ns_file_name %> => valid_attributes }, valid_session
74
- expect(response).to redirect_to(<%= class_name %>.last)
75
- end
76
- end
77
-
78
- describe "with invalid params" do
79
- it "assigns a newly created but unsaved <%= ns_file_name %> as @<%= ns_file_name %>" do
80
- # Trigger the behavior that occurs when invalid params are submitted
81
- <%= class_name %>.any_instance.stub(:save).and_return(false)
82
- post :create, { :<%= ns_file_name %> => <%= formatted_hash(example_invalid_attributes) %> }, valid_session
83
- expect(assigns(:<%= ns_file_name %>)).to be_a_new(<%= class_name %>)
84
- end
85
-
86
- it "re-renders the 'new' template" do
87
- # Trigger the behavior that occurs when invalid params are submitted
88
- <%= class_name %>.any_instance.stub(:save).and_return(false)
89
- post :create, { :<%= ns_file_name %> => <%= formatted_hash(example_invalid_attributes) %> }, valid_session
90
- expect(response).to render_template("new")
91
- end
92
- end
93
- end
94
-
95
- describe "#update" do
96
- describe "with valid params" do
97
- it "updates the requested <%= ns_file_name %>" do
98
- <%= file_name %> = <%= class_name %>.create! valid_attributes
99
- # Assuming there are no other <%= table_name %> in the database, this
100
- # specifies that the <%= class_name %> created on the previous line
101
- # receives the :update_attributes message with whatever params are
102
- # submitted in the request.
103
- <%= class_name %>.any_instance.should_receive(:update_attributes).with(<%= formatted_hash(example_params_for_update) %>)
104
- put :update, { :id => <%= file_name %>.to_param, :<%= ns_file_name %> => <%= formatted_hash(example_params_for_update) %> }, valid_session
105
- end
106
-
107
- it "assigns the requested <%= ns_file_name %> as @<%= ns_file_name %>" do
108
- <%= file_name %> = <%= class_name %>.create! valid_attributes
109
- put :update, { :id => <%= file_name %>.to_param, :<%= ns_file_name %> => valid_attributes }, valid_session
110
- expect(assigns(:<%= ns_file_name %>)).to eq(<%= file_name %>)
111
- end
112
-
113
- it "redirects to the <%= ns_file_name %>" do
114
- <%= file_name %> = <%= class_name %>.create! valid_attributes
115
- put :update, { :id => <%= file_name %>.to_param, :<%= ns_file_name %> => valid_attributes }, valid_session
116
- expect(response).to redirect_to(<%= file_name %>)
117
- end
118
- end
119
-
120
- describe "with invalid params" do
121
- it "assigns the <%= ns_file_name %> as @<%= ns_file_name %>" do
122
- <%= file_name %> = <%= class_name %>.create! valid_attributes
123
- # Trigger the behavior that occurs when invalid params are submitted
124
- <%= class_name %>.any_instance.stub(:save).and_return(false)
125
- put :update, { :id => <%= file_name %>.to_param, :<%= ns_file_name %> => <%= formatted_hash(example_invalid_attributes) %> }, valid_session
126
- expect(assigns(:<%= ns_file_name %>)).to eq(<%= file_name %>)
127
- end
128
-
129
- it "re-renders the 'edit' template" do
130
- <%= file_name %> = <%= class_name %>.create! valid_attributes
131
- # Trigger the behavior that occurs when invalid params are submitted
132
- <%= class_name %>.any_instance.stub(:save).and_return(false)
133
- put :update, { :id => <%= file_name %>.to_param, :<%= ns_file_name %> => <%= formatted_hash(example_invalid_attributes) %> }, valid_session
134
- expect(response).to render_template("edit")
135
- end
136
- end
137
- end
138
-
139
- describe "#destroy" do
140
- it "destroys the requested <%= ns_file_name %>" do
141
- <%= file_name %> = <%= class_name %>.create! valid_attributes
142
- expect {
143
- delete :destroy, { :id => <%= file_name %>.to_param }, valid_session
144
- }.to change(<%= class_name %>, :count).by(-1)
145
- end
146
-
147
- it "redirects to the <%= table_name %> list" do
148
- <%= file_name %> = <%= class_name %>.create! valid_attributes
149
- delete :destroy, { :id => <%= file_name %>.to_param }, valid_session
150
- expect(response).to redirect_to(<%= index_helper %>_url)
151
- end
152
- end
153
-
154
- end
155
- <% end -%>
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/edit" do
5
- before(:each) do
6
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, build_stubbed(:<%= class_name.underscore %>))
7
- end
8
-
9
- it "renders the edit <%= ns_file_name %> form" do
10
- render
11
-
12
- assert_select "form", action: <%= index_helper %>_path(@<%= ns_file_name %>), method: "post" do
13
- <% for attribute in output_attributes -%>
14
- assert_select "<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", name: "<%= ns_file_name %>[<%= attribute.name %>]"
15
- <% end -%>
16
- end
17
- end
18
- end
@@ -1,26 +0,0 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/index" do
5
- before(:each) do
6
- assign(:<%= table_name %>, [
7
- <% [1,2].each_with_index do |id, model_index| -%>
8
- build_stubbed(:<%= class_name.underscore %><%= output_attributes.empty? ? (model_index == 1 ? ')' : '),') : ',' %>
9
- <% output_attributes.each_with_index do |attribute, attribute_index| -%>
10
- <%= attribute.name %>: <%= value_for(attribute) %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
11
- <% end -%>
12
- <% if !output_attributes.empty? -%>
13
- <%= model_index == 1 ? ')' : '),' %>
14
- <% end -%>
15
- <% end -%>
16
- ])
17
- end
18
-
19
- it "renders a list of <%= ns_table_name %>" do
20
- render
21
-
22
- <% for attribute in output_attributes -%>
23
- assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count: 2
24
- <% end -%>
25
- end
26
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/new" do
5
- before(:each) do
6
- assign(:<%= ns_file_name %>, build_stubbed(:<%= class_name.underscore %>))
7
- end
8
-
9
- it "renders new <%= ns_file_name %> form" do
10
- render
11
-
12
- assert_select "form", action: <%= index_helper %>_path, method: "post" do
13
- <% for attribute in output_attributes -%>
14
- assert_select "<%= attribute.input_type -%>#<%= ns_file_name %>_<%= attribute.name %>", name: "<%= ns_file_name %>[<%= attribute.name %>]"
15
- <% end -%>
16
- end
17
- end
18
- end
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
- describe "<%= ns_table_name %>/show" do
5
- before(:each) do
6
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, build_stubbed(:<%= class_name.underscore %>))
7
- end
8
-
9
- it "renders attributes" do
10
- render
11
-
12
- <% for attribute in output_attributes -%>
13
- expect(rendered).to match(/<%= eval(value_for(attribute)) %>/)
14
- <% end -%>
15
- end
16
- end
@@ -1,13 +0,0 @@
1
- = simple_form_for(@<%= singular_table_name %>) do |f|
2
- = f.error_notification
3
-
4
- .form-inputs
5
- <%- attributes.each_with_index do |attribute, i| -%>
6
- = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %><%= ', autofocus: true' if i == 0 %>
7
- <%- end -%>
8
-
9
- .form-actions
10
- = f.button :submit, class: 'btn btn-primary'
11
- '
12
- = link_to 'Back', <%= index_helper %>_path, class: 'btn'
13
-
@@ -1,5 +0,0 @@
1
- .page-header
2
- h1 Editing <%= singular_table_name %>
3
-
4
- == render 'form'
5
-
@@ -1,28 +0,0 @@
1
- div.page-header
2
- h1 Listing <%= plural_table_name %>
3
-
4
- table.table.table-striped
5
- thead
6
- tr
7
- th ID
8
- <% attributes.each do |attribute| -%>
9
- th <%= attribute.human_name %>
10
- <% end -%>
11
- th Actions
12
-
13
- tbody
14
- - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
15
- tr
16
- td= link_to_if can?(:show, <%= singular_table_name %>), <%= singular_table_name %>.id, <%= singular_table_name %>_path(<%= singular_table_name %>)
17
- <% attributes.each do |attribute| -%>
18
- td= <%= singular_table_name %>.<%= attribute.name %>
19
- <% end -%>
20
- td
21
- - if can? :edit, <%= singular_table_name %>
22
- = link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'btn btn-mini'
23
- '
24
- - if can? :destroy, <%= singular_table_name %>
25
- = link_to 'Destroy', <%= singular_table_name %>_path(<%= singular_table_name %>), method: :delete, data: { confirm: "Are you sure?" }, class: 'btn btn-mini btn-danger'
26
-
27
- - if can? :create, <%= singular_table_name.classify %>
28
- = link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path, class: 'btn btn-primary'
@@ -1,4 +0,0 @@
1
- .page-header
2
- h1 Create <%= singular_table_name %>
3
-
4
- == render 'form'
@@ -1,17 +0,0 @@
1
- .page-header
2
- h1 <%= singular_table_name.capitalize %>
3
-
4
- dl
5
- <% attributes.each do |attribute| -%>
6
- dt <%= attribute.human_name %>
7
- dd= @<%= singular_table_name %>.<%= attribute.name %>
8
- <% end -%>
9
-
10
- - if can?(:edit, @<%= singular_table_name %>)
11
- = link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'btn'
12
- '
13
- = link_to 'Back', <%= index_helper %>_path, class: 'btn'
14
-
15
- - if can?(:destroy, @<%= singular_table_name %>)
16
- '
17
- = link_to'Destroy', <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, data: { confirm: "Are you sure?" }, class: 'btn btn-danger'
File without changes
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
File without changes
@@ -1,5 +0,0 @@
1
- # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
- #
3
- # To ban all spiders from the entire site uncomment the next two lines:
4
- # User-Agent: *
5
- # Disallow: /
@@ -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,42 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe UserSessionsController do
4
-
5
- describe "#new" do
6
- it "assigns a new user as @user" do
7
- get :new
8
- expect(assigns(:user_session)).to_not be_nil
9
- end
10
- end
11
-
12
- describe "#create" do
13
- describe "with valid params" do
14
- it "redirect to the target page" do
15
- subject.stub(:login) { build_stubbed :user }
16
- post :create, { user_session: { email: 'valid', password: 'valid' } }, { return_to_url: 'url' }
17
- expect(response).to redirect_to('url')
18
- end
19
- end
20
-
21
- describe "with invalid params" do
22
- it "re-renders the 'new' template" do
23
- subject.stub(:login) { nil }
24
- post :create, { user_session: { email: 'invalid', password: 'invalid' } }
25
- expect(response).to render_template('new')
26
- end
27
- end
28
- end
29
-
30
- describe "#destroy" do
31
- it "destroys the requested user session" do
32
- subject.should_receive(:logout)
33
- delete :destroy
34
- end
35
-
36
- it "redirects to the sign in page" do
37
- delete :destroy
38
- expect(response).to redirect_to(sign_in_url)
39
- end
40
- end
41
-
42
- end