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,150 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe UsersController do
4
-
5
- # This should return the minimal set of attributes required to create a valid
6
- # User. As you add validations to User, be sure to
7
- # update the return value of this method accordingly.
8
- def valid_attributes
9
- attributes_for :user
10
- end
11
-
12
- # This returns the minimal set of values that should be in the session
13
- # in order to pass any filters (e.g. authentication) defined in
14
- # UsersController. Be sure to keep this updated too.
15
- def valid_session
16
- {}
17
- end
18
-
19
- before do
20
- login_user build :admin
21
- end
22
-
23
- describe "#index" do
24
- it "assigns all users as @users" do
25
- user = User.create! valid_attributes
26
- get :index, {}, valid_session
27
- expect(assigns(:users)).to eq([user])
28
- end
29
- end
30
-
31
- describe "#show" do
32
- it "assigns the requested user as @user" do
33
- user = User.create! valid_attributes
34
- get :show, { id: user.to_param }, valid_session
35
- expect(assigns(:user)).to eq(user)
36
- end
37
- end
38
-
39
- describe "#new" do
40
- it "assigns a new user as @user" do
41
- get :new, {}, valid_session
42
- expect(assigns(:user)).to be_a_new(User)
43
- end
44
- end
45
-
46
- describe "#edit" do
47
- it "assigns the requested user as @user" do
48
- user = User.create! valid_attributes
49
- get :edit, { id: user.to_param }, valid_session
50
- expect(assigns(:user)).to eq(user)
51
- end
52
- end
53
-
54
- describe "#create" do
55
- describe "with valid params" do
56
- it "creates a new User" do
57
- expect {
58
- post :create, { user: valid_attributes }, valid_session
59
- }.to change(User, :count).by(1)
60
- end
61
-
62
- it "assigns a newly created user as @user" do
63
- post :create, { user: valid_attributes }, valid_session
64
- expect(assigns(:user)).to be_a(User)
65
- expect(assigns(:user)).to be_persisted
66
- end
67
-
68
- it "redirects to the created user" do
69
- post :create, { user: valid_attributes }, valid_session
70
- expect(response).to redirect_to(User.last)
71
- end
72
- end
73
-
74
- describe "with invalid params" do
75
- it "assigns a newly created but unsaved user as @user" do
76
- # Trigger the behavior that occurs when invalid params are submitted
77
- User.any_instance.stub(:save).and_return(false)
78
- post :create, { user: { "email" => "invalid value" } }, valid_session
79
- expect(assigns(:user)).to be_a_new(User)
80
- end
81
-
82
- it "re-renders the 'new' template" do
83
- # Trigger the behavior that occurs when invalid params are submitted
84
- User.any_instance.stub(:save).and_return(false)
85
- post :create, { user: { "email" => "invalid value" } }, valid_session
86
- expect(response).to render_template("new")
87
- end
88
- end
89
- end
90
-
91
- describe "#update" do
92
- describe "with valid params" do
93
- it "updates the requested user" do
94
- user = User.create! valid_attributes
95
- # Assuming there are no other users in the database, this
96
- # specifies that the User created on the previous line
97
- # receives the :update_attributes message with whatever params are
98
- # submitted in the request.
99
- User.any_instance.should_receive(:update_attributes).with({ "email" => "MyString" })
100
- put :update, { id: user.to_param, user: { "email" => "MyString" } }, valid_session
101
- end
102
-
103
- it "assigns the requested user as @user" do
104
- user = User.create! valid_attributes
105
- put :update, { id: user.to_param, user: valid_attributes }, valid_session
106
- expect(assigns(:user)).to eq(user)
107
- end
108
-
109
- it "redirects to the user" do
110
- user = User.create! valid_attributes
111
- put :update, { id: user.to_param, user: valid_attributes }, valid_session
112
- expect(response).to redirect_to(user)
113
- end
114
- end
115
-
116
- describe "with invalid params" do
117
- it "assigns the user as @user" do
118
- user = User.create! valid_attributes
119
- # Trigger the behavior that occurs when invalid params are submitted
120
- User.any_instance.stub(:save).and_return(false)
121
- put :update, { id: user.to_param, user: { "email" => "invalid value" } }, valid_session
122
- expect(assigns(:user)).to eq(user)
123
- end
124
-
125
- it "re-renders the 'edit' template" do
126
- user = User.create! valid_attributes
127
- # Trigger the behavior that occurs when invalid params are submitted
128
- User.any_instance.stub(:save).and_return(false)
129
- put :update, { id: user.to_param, user: { "email" => "invalid value" } }, valid_session
130
- expect(response).to render_template("edit")
131
- end
132
- end
133
- end
134
-
135
- describe "#destroy" do
136
- it "destroys the requested user" do
137
- user = User.create! valid_attributes
138
- expect {
139
- delete :destroy, { id: user.to_param }, valid_session
140
- }.to change(User, :count).by(-1)
141
- end
142
-
143
- it "redirects to the users list" do
144
- user = User.create! valid_attributes
145
- delete :destroy, { id: user.to_param }, valid_session
146
- expect(response).to redirect_to(users_url)
147
- end
148
- end
149
-
150
- end
@@ -1,14 +0,0 @@
1
- # Read about factories at https://github.com/thoughtbot/factory_girl
2
-
3
- FactoryGirl.define do
4
- factory :user do
5
- sequence(:email) { |n| "person#{n}@example.com" }
6
- name 'Tom Middleton'
7
- password 'password'
8
-
9
- factory :admin do
10
- name 'Admin'
11
- admin true
12
- end
13
- end
14
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- feature "Activation" do
4
- scenario "with a valid token should activate the user and sign them in" do
5
- @user = create(:user)
6
- visit activation_path(@user.activation_token)
7
-
8
- expect(current_path).to eq sign_in_path
9
- expect(page).to have_content "Your account has been activated and you're now signed in."
10
- end
11
-
12
- scenario "with an invalid token should send the user to sign in" do
13
- visit activation_path('BOGUS')
14
-
15
- expect(current_path).to eq sign_in_path
16
- expect(page).to have_content "Please sign in first."
17
- end
18
- end
@@ -1,41 +0,0 @@
1
- require 'spec_helper'
2
-
3
- feature "Password Reset" do
4
- background do
5
- clear_emails
6
- @user = create(:user)
7
- @user.activate!
8
-
9
- visit sign_in_path
10
- click_link 'Reset Password'
11
-
12
- fill_in 'Email', with: @user.email
13
- click_button 'Reset My Password'
14
-
15
- @user.reload
16
- end
17
-
18
- after do
19
- @user.destroy
20
- end
21
-
22
- scenario "displays a message about the password reset email" do
23
- expect(page).to have_content "Password reset instructions have been sent to your email."
24
- expect(current_path).to eq sign_in_path
25
- end
26
-
27
- scenario "sends a password reset email with url" do
28
- expect(open_email(@user.email)).to_not be_nil
29
- expect(current_email).to have_content reset_password_path(@user.reset_password_token)
30
- end
31
-
32
- scenario "resets the password" do
33
- visit reset_password_path(@user.reset_password_token)
34
-
35
- fill_in 'New Password', with: 'som3_g00d_p@ssword'
36
- click_button 'Reset Password'
37
-
38
- expect(page).to have_content "Password was successfully updated."
39
- expect(current_path).to eq sign_in_path
40
- end
41
- end
@@ -1,39 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # http://www.elabs.se/blog/51-simple-tricks-to-clean-up-your-capybara-tests
4
-
5
- feature "Registration" do
6
- background do
7
- clear_emails
8
-
9
- @email = 'stan@example.com'
10
-
11
- visit sign_up_path
12
-
13
- within '#new_user' do
14
- fill_in 'Email', with: @email
15
- fill_in 'Name', with: 'Stan'
16
- fill_in 'Password', with: 'p@ssword'
17
- click_button 'Sign Up'
18
- end
19
-
20
- @user = User.find_by_email(@email)
21
- end
22
-
23
- after do
24
- @user.destroy
25
- end
26
-
27
- it "creates a new user" do
28
- expect(@user).to_not be_nil
29
- end
30
-
31
- it "displays a message about activation" do
32
- expect(find('.alert')).to have_content "Thanks for signing up. Please check your email for activation instructions."
33
- end
34
-
35
- it "sends the activation email with url" do
36
- expect(open_email(@email)).to_not be_nil
37
- expect(current_email).to have_content activation_path(@user.activation_token)
38
- end
39
- end
@@ -1,30 +0,0 @@
1
- require 'spec_helper'
2
-
3
- feature "Sign In" do
4
- background(:all) do
5
- @user = create(:user)
6
- @user.activate!
7
- end
8
-
9
- after(:all) do
10
- @user.destroy
11
- end
12
-
13
- scenario "authenticates with valid credentials" do
14
- sign_in(@user.email, 'password')
15
-
16
- expect(find('.alert')).to have_content("Successfully signed in")
17
- end
18
-
19
- scenario "displays a generic error message with an invalid email" do
20
- sign_in('this is not valid', 'password')
21
-
22
- expect(find('.alert')).to have_content("Sign in failed")
23
- end
24
-
25
- scenario "displays a generic error message with an invalid password" do
26
- sign_in(@user.email, 'this is not valid')
27
-
28
- expect(find('.alert')).to have_content("Sign in failed")
29
- end
30
- end
@@ -1,20 +0,0 @@
1
- # This is an example spec, delete when there are some real specs.
2
-
3
- class Foo
4
- bar: ->
5
- false
6
-
7
- class Bar
8
- foo: ->
9
- false
10
-
11
-
12
- describe "Foo", ->
13
- it "it is not bar", ->
14
- v = new Foo()
15
- expect(v.bar()).toEqual(false)
16
-
17
- describe "Bar", ->
18
- it "it is not foo", ->
19
- v = new Bar()
20
- expect(v.foo()).toEqual(false)
@@ -1,3 +0,0 @@
1
- /*
2
- *=require application
3
- */
@@ -1,2 +0,0 @@
1
- #=require application
2
- #=require_tree ./
@@ -1,48 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe UserMailer do
4
- let(:user) { build_stubbed(:user, activation_state: 'pending', activation_token: 'ABC', reset_password_token: 'XYZ') }
5
-
6
- describe "#activation_needed_email" do
7
- let(:mail) { UserMailer.activation_needed_email(user) }
8
-
9
- it "renders the headers" do
10
- expect(mail.subject).to eq "Welcome to My Awesome Site!"
11
- expect(mail.to).to eq [user.email]
12
- expect(mail.from).to eq %w(notifications@example.com)
13
- end
14
-
15
- it "renders the body" do
16
- expect(mail.body.encoded).to match "Welcome to"
17
- end
18
- end
19
-
20
- describe "#activation_success_email" do
21
- let(:mail) { UserMailer.activation_success_email(user) }
22
-
23
- it "renders the headers" do
24
- expect(mail.subject).to eq "Your account has been activated!"
25
- expect(mail.to).to eq [user.email]
26
- expect(mail.from).to eq %w(notifications@example.com)
27
- end
28
-
29
- it "renders the body" do
30
- expect(mail.body.encoded).to match "You have successfully activated"
31
- end
32
- end
33
-
34
- describe "#reset_password_email" do
35
- let(:mail) { UserMailer.reset_password_email(user) }
36
-
37
- it "renders the headers" do
38
- expect(mail.subject).to eq "Password reset requested"
39
- expect(mail.to).to eq [user.email]
40
- expect(mail.from).to eq %w(notifications@example.com)
41
- end
42
-
43
- it "renders the body" do
44
- expect(mail.body.encoded).to match "Someone requested to reset your password."
45
- end
46
- end
47
-
48
- end
@@ -1,38 +0,0 @@
1
- require 'spec_helper'
2
- require 'cancan/matchers'
3
-
4
- describe "User" do
5
- subject { ability }
6
- let(:ability) { Ability.new(user) }
7
- let(:other) { build(:user) { |u| u.id = 2 } }
8
-
9
- context "when working with User" do
10
- context "as a non-admin" do
11
- let(:user) { build(:user) { |u| u.id = 1 } }
12
-
13
- context "operating on themselves" do
14
- it { should be_able_to(:read, user) }
15
- it { should be_able_to(:update, user) }
16
- it { should_not be_able_to(:destroy, user) }
17
- end
18
-
19
- context "operating on someone else" do
20
- it { should_not be_able_to(:manage, other) }
21
- it { should_not be_able_to(:create, User) }
22
- end
23
- end
24
-
25
- context "as an admin" do
26
- let(:user) { build(:admin) { |u| u.id = 1 } }
27
-
28
- context "operating on themselves" do
29
- it { should be_able_to(:manage, user) }
30
- it { should_not be_able_to(:destroy, user) }
31
- end
32
-
33
- context "operating on someone else" do
34
- it { should be_able_to(:manage, other) }
35
- end
36
- end
37
- end
38
- end
@@ -1,36 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe User do
4
- describe "validations" do
5
-
6
- subject { build(:user) }
7
-
8
- describe "name" do
9
- it "is required" do
10
- expect(subject).to_not accept_values(:name, nil, '')
11
- end
12
-
13
- it "should be less than 30 characters" do
14
- expect(subject).to accept_values(:name, 'a' * 30)
15
- expect(subject).to_not accept_values(:name, 'a' * 31)
16
- end
17
- end
18
-
19
- describe "email" do
20
- it "is required" do
21
- expect(subject).to_not accept_values(:email, nil, '', ' ')
22
- end
23
-
24
- it "must be properly formatted" do
25
- expect(subject).to accept_values(:email, 'a@b.com', 'a@b.c.com')
26
- expect(subject).to_not accept_values(:email, 'a@b', 'a.b.com')
27
- end
28
-
29
- it "must be unique" do
30
- subject.save
31
- stunt_double = subject.dup
32
- expect(stunt_double).to_not accept_values(:email, subject.email)
33
- end
34
- end
35
- end
36
- end
@@ -1,64 +0,0 @@
1
- # Coverage must be enabled before the application is loaded.
2
- if ENV['COVERAGE']
3
- require 'simplecov'
4
-
5
- # Writes the coverage stat to a file to be used by Cane.
6
- class SimpleCov::Formatter::QualityFormatter
7
- def format(result)
8
- SimpleCov::Formatter::HTMLFormatter.new.format(result)
9
- File.open('coverage/covered_percent', 'w') do |f|
10
- f.puts result.source_files.covered_percent.to_f
11
- end
12
- end
13
- end
14
- SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
15
-
16
- SimpleCov.start do
17
- add_filter '/spec/'
18
- add_filter '/config/'
19
- add_filter '/vendor/'
20
- add_group 'Models', 'app/models'
21
- add_group 'Controllers', 'app/controllers'
22
- add_group 'Helpers', 'app/helpers'
23
- add_group 'Views', 'app/views'
24
- add_group 'Mailers', 'app/mailers'
25
- end
26
- end
27
-
28
- ENV['RAILS_ENV'] ||= 'test'
29
- require File.expand_path('../../config/environment', __FILE__)
30
- require 'rspec/rails'
31
- require 'rspec/autorun'
32
- require 'capybara/email/rspec'
33
-
34
- # Requires supporting ruby files with custom matchers and macros, etc,
35
- # in spec/support/ and its subdirectories.
36
- Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
37
-
38
- RSpec.configure do |config|
39
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
40
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
41
-
42
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
43
- # examples within a transaction, remove the following line or assign false
44
- # instead of true.
45
- config.use_transactional_fixtures = false
46
-
47
- # If true, the base class of anonymous controllers will be inferred
48
- # automatically. This will be the default behavior in future versions of
49
- # rspec-rails.
50
- config.infer_base_class_for_anonymous_controllers = false
51
-
52
- config.expect_with :rspec do |c|
53
- c.syntax = :expect
54
- end
55
-
56
- # Run specs in random order to surface order dependencies. If you find an
57
- # order dependency and want to debug it, you can fix the order by providing
58
- # the seed, which is printed after each run.
59
- # --seed 1234
60
- config.order = "random"
61
- end
62
-
63
- # Turn down the logging while testing.
64
- Rails.logger.level = 4
@@ -1,55 +0,0 @@
1
- # Based on https://github.com/bogdan/accept_values_for
2
-
3
- def accept_values(attribute, *values)
4
- AcceptValues.new(attribute, *values)
5
- end
6
-
7
- class AcceptValues #:nodoc:
8
-
9
- def initialize(attribute, *values)
10
- @attribute = attribute
11
- @values = values
12
- end
13
-
14
- def matches?(model)
15
- @model = model
16
- #return false unless model.is_a?(ActiveRecord::Base)
17
- @values.each do |value|
18
- model.send("#{@attribute}=", value)
19
- model.valid?
20
- if model.errors[@attribute].present?
21
- @failed_value = value
22
- return false
23
- end
24
- end
25
- true
26
- end
27
-
28
- def does_not_match?(model)
29
- @model = model
30
- #return false unless model.is_a?(ActiveRecord::Base)
31
- @values.each do |value|
32
- model.send("#{@attribute}=", value)
33
- model.valid?
34
- unless model.errors[@attribute].present?
35
- @failed_value = value
36
- return false
37
- end
38
- end
39
- true
40
- end
41
-
42
- def failure_message_for_should
43
- result = "expected #{@model.class.name} to accept value #{@failed_value.inspect} for #{@attribute.inspect}\n"
44
- result += 'Errors: ' + @model.errors[@attribute].join(', ') if @model.respond_to?(:errors)
45
- result
46
- end
47
-
48
- def failure_message_for_should_not
49
- "expected #{@model.class.name} to reject value #{@failed_value.inspect} for #{@attribute.inspect} attribute"
50
- end
51
-
52
- def description
53
- "accept values #{@values.map(&:inspect).join(', ')} for #{@attribute.inspect}"
54
- end
55
- end
@@ -1,24 +0,0 @@
1
- # Good read on using database_cleaner (in lieu of a shared connection):
2
- # http://devblog.avdi.org/2012/08/31/configuring-database_cleaner-with-rails-rspec-capybara-and-selenium/
3
-
4
- RSpec.configure do |config|
5
- config.before(:suite) do
6
- DatabaseCleaner.clean_with(:truncation)
7
- end
8
-
9
- config.before(:each) do
10
- DatabaseCleaner.strategy = :transaction
11
- end
12
-
13
- config.before(:each, js: true) do
14
- DatabaseCleaner.strategy = :truncation
15
- end
16
-
17
- config.before(:each) do
18
- DatabaseCleaner.start
19
- end
20
-
21
- config.after(:each) do
22
- DatabaseCleaner.clean
23
- end
24
- end
@@ -1,3 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include FactoryGirl::Syntax::Methods
3
- end
@@ -1,3 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include Sorcery::TestHelpers::Rails
3
- end
@@ -1,21 +0,0 @@
1
- module UserSessionsFeatureHelper
2
-
3
- def sign_in(email, password)
4
- visit sign_in_path
5
-
6
- within('#new_user_session') do
7
- fill_in 'Email', with: email
8
- fill_in 'Password', with: password
9
- click_on 'Sign In'
10
- end
11
- end
12
-
13
- def sign_out
14
- visit sign_out_path
15
- end
16
-
17
- end
18
-
19
- RSpec.configure do |config|
20
- config.include UserSessionsFeatureHelper, type: :feature
21
- end
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "users/edit" do
4
- before(:each) do
5
- @user = assign(:user, build_stubbed(:user))
6
- end
7
-
8
- it "renders the edit user form" do
9
- render
10
-
11
- assert_select "form", action: users_path(@user), method: "post" do
12
- assert_select "input#user_email", name: "user[email]"
13
- assert_select "input#user_name", name: "user[name]"
14
- end
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "users/index" do
4
- before(:each) do
5
- assign(:users, [
6
- build_stubbed(:user, name: "Name", email: "Email"),
7
- build_stubbed(:user, name: "Name", email: "Email")
8
- ])
9
- end
10
-
11
- it "renders a list of users" do
12
- render
13
- assert_select "tr>td", text: "Email".to_s, count: 2
14
- assert_select "tr>td", text: "Name".to_s, count: 2
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "users/new" do
4
- before(:each) do
5
- assign(:user, build_stubbed(:user))
6
- end
7
-
8
- it "renders new user form" do
9
- render
10
-
11
- assert_select "form", action: users_path, method: "post" do
12
- assert_select "input#user_email", name: "user[email]"
13
- assert_select "input#user_name", name: "user[name]"
14
- end
15
- end
16
- end