jinda 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/jinda/install_generator.rb +24 -10
  3. data/lib/generators/jinda/templates/app/assets/javascripts/application.js-jqm +2 -0
  4. data/lib/generators/jinda/templates/app/assets/stylesheets/{application.css → application.css.scss} +0 -0
  5. data/lib/generators/jinda/templates/app/controllers/api/v1/notes_controller.rb +81 -0
  6. data/lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb +22 -0
  7. data/lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb +86 -0
  8. data/lib/generators/jinda/templates/app/jinda/index.mm +138 -21
  9. data/lib/generators/jinda/templates/app/mailers/note_mailer.rb +10 -0
  10. data/lib/generators/jinda/templates/app/models/note.rb +22 -0
  11. data/lib/generators/jinda/templates/app/views/api/v1/note.haml +0 -0
  12. data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +1 -1
  13. data/lib/generators/jinda/templates/app/views/jinda/run_form.haml +4 -0
  14. data/lib/generators/jinda/templates/app/views/note_mailer/gmail.html.haml +7 -0
  15. data/lib/generators/jinda/templates/app/views/note_mailer/gmail.text.haml +8 -0
  16. data/lib/generators/jinda/templates/app/views/notes/delete/select_note.html.erb +14 -0
  17. data/lib/generators/jinda/templates/app/views/notes/edit/edit_note.html.erb +10 -0
  18. data/lib/generators/jinda/templates/app/views/notes/edit/select_note.html.erb +14 -0
  19. data/lib/generators/jinda/templates/app/views/notes/index.haml +71 -0
  20. data/lib/generators/jinda/templates/app/views/notes/mail/display_mail.html.erb +20 -0
  21. data/lib/generators/jinda/templates/app/views/notes/mail/select_note.html.erb +19 -0
  22. data/lib/generators/jinda/templates/app/views/notes/mail/show.html.haml +13 -0
  23. data/lib/generators/jinda/templates/app/views/notes/my.haml +21 -0
  24. data/lib/generators/jinda/templates/app/views/notes/new/new_note.html.erb +13 -0
  25. data/lib/generators/jinda/templates/app/views/notes/show.haml +10 -0
  26. data/lib/generators/jinda/templates/app/views/notes/xedit/edit_note.html.erb +10 -0
  27. data/lib/generators/jinda/templates/spec/controllers/api/v1_get_index_spec.rb +23 -0
  28. data/lib/generators/jinda/templates/spec/controllers/api/v1_get_my_spec.rb +14 -0
  29. data/lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb +19 -0
  30. data/lib/generators/jinda/templates/spec/mailers/note_spec.rb +24 -0
  31. data/lib/generators/jinda/templates/spec/mailers/previews/note_preview.rb +9 -0
  32. data/lib/generators/jinda/templates/spec/models/note_spec.rb +41 -0
  33. data/lib/generators/jinda/templates/spec/rails_helper.rb +29 -40
  34. data/lib/generators/jinda/templates/spec/support/authentication_helper.rb +20 -0
  35. data/lib/generators/jinda/templates/spec/support/factory_bot.rb +9 -3
  36. data/lib/generators/jinda/templates/spec/support/request_spec_helper.rb +8 -0
  37. data/lib/jinda/ template/view.html.erb +0 -2
  38. data/lib/jinda/version.rb +1 -1
  39. metadata +29 -4
  40. data/lib/generators/jinda/templates/install.sh +0 -7
@@ -7,49 +7,38 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
7
7
  require 'rspec/rails'
8
8
  require 'spec_helper'
9
9
  require 'support/factory_bot'
10
- # Add additional requires below this line. Rails is not loaded until this point!
11
-
12
- # Requires supporting ruby files with custom matchers and macros, etc, in
13
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
14
- # run as spec files by default. This means that files in spec/support that end
15
- # in _spec.rb will both be required and run as specs, causing the specs to be
16
- # run twice. It is recommended that you do not name files matching this glob to
17
- # end with _spec.rb. You can configure this pattern with the --pattern
18
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
19
- #
20
- # The following line is provided for convenience purposes. It has the downside
21
- # of increasing the boot-up time by auto-requiring all files in the support
22
- # directory. Alternatively, in the individual `*_spec.rb` files, manually
23
- # require only the support files necessary.
24
- # Enable all!
25
10
  Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
26
11
 
27
- RSpec.configure do |config|
28
- # RSpec Rails can automatically mix in different behaviours to your tests
29
- # based on their file location, for example enabling you to call `get` and
30
- # `post` in specs under `spec/controllers`.
31
- #
32
- # You can disable this behaviour by removing the line below, and instead
33
- # explicitly tag your specs with their type, e.g.:
34
- #
35
- # RSpec.describe UsersController, :type => :controller do
36
- # # ...
37
- # end
38
- #
39
- # The different available types are documented in the features, such as in
40
- # https://relishapp.com/rspec/rspec-rails/docs
41
- config.infer_spec_type_from_file_location!
42
-
43
- # Filter lines from Rails gems in backtraces.
44
- config.filter_rails_from_backtrace!
45
- # arbitrary gems may also be filtered via:
46
- # config.filter_gems_from_backtrace("gem name")
47
-
12
+ RSpec.configure do |config|
13
+
14
+ # Add create_and_sign_in_user
15
+ config.include AuthenticationHelper, type: :controller
16
+
17
+ # To include RequestSpecHelper
18
+ config.include RequestSpecHelper, type: :request
19
+
20
+ # config.infer_spec_type_from_file_location!
21
+
22
+ # Filter lines from Rails gems in backtraces.
23
+ config.filter_rails_from_backtrace!
24
+ # arbitrary gems may also be filtered via:
25
+ # config.filter_gems_from_backtrace("gem name")
26
+
27
+
28
+
48
29
  # Added to make factorybot work
49
- FactoryBot.allow_class_lookup = false
30
+ FactoryBot.allow_class_lookup = false
31
+ config.use_transactional_fixtures = false
50
32
  config.include FactoryBot::Syntax::Methods
51
- config.before do
52
- FactoryBot.find_definitions
53
- end
33
+ config.before do
34
+ FactoryBot.find_definitions
35
+ end
36
+ # configure shoulda matchers to use rspec as the test framework and full matcher libraries for rails
37
+ Shoulda::Matchers.configure do |config|
38
+ config.integrate do |with|
39
+ with.test_framework :rspec
40
+ with.library :rails
41
+ end
42
+ end
54
43
 
55
44
  end
@@ -0,0 +1,20 @@
1
+ module AuthenticationHelper
2
+ # controller return 1. Session 2. Cookies ==> user.id
3
+ def sign_in(user)
4
+ @user = user
5
+ current_ma_user
6
+ end
7
+
8
+ def create_and_sign_in_user
9
+ user = FactoryBot.create(:user)
10
+ sign_in(user)
11
+ return user
12
+ end
13
+ # from Jinda::Helpers
14
+ def current_ma_user
15
+ @user ||= User.where(:auth_token => user.auth_token)
16
+ return @user
17
+ end
18
+
19
+ end
20
+
@@ -1,6 +1,12 @@
1
1
  FactoryBot.define do
2
- factory :user, class: User do
3
- code {"Tester"}
4
- email {"tester@test.comm"}
2
+ factory :user, class: 'User' do
3
+ code {Faker::Name.unique.name}
4
+ email {Faker::Internet.email}
5
+ role {"Admin"}
6
+ end
7
+ factory :note, class: 'Note' do
8
+ title { Faker::Lorem.sentence[0..29] }
9
+ body { Faker::Lorem.sentence[0..999] }
10
+ user { User.first }
5
11
  end
6
12
  end
@@ -0,0 +1,8 @@
1
+ #request_spec_helper.rb
2
+
3
+ module RequestSpecHelper
4
+ # Parse JSON response to ruby hash
5
+ def json
6
+ JSON.parse(response.body)
7
+ end
8
+ end
@@ -14,8 +14,6 @@
14
14
  </div-->
15
15
  <%= f.label :issue_on, "Dated" %>
16
16
  <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
17
- <%= f.label :y, "Summary" %>
18
- <%= f.text_area :summary, :cols=>50, :rows=>6 %>
19
17
  <%= f.label :dscan, "Attached document" %>
20
18
  <%= f.file_field :dscan %>
21
19
  <% end %>
data/lib/jinda/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jinda
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jinda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Prateep Kul
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-12-12 00:00:00.000000000 Z
12
+ date: 2020-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -165,7 +165,7 @@ files:
165
165
  - lib/generators/jinda/templates/app/assets/javascripts/jquery.mobile.datebox.js
166
166
  - lib/generators/jinda/templates/app/assets/javascripts/jquery.mobile.splitview.js
167
167
  - lib/generators/jinda/templates/app/assets/stylesheets/app.scss
168
- - lib/generators/jinda/templates/app/assets/stylesheets/application.css
168
+ - lib/generators/jinda/templates/app/assets/stylesheets/application.css.scss
169
169
  - lib/generators/jinda/templates/app/assets/stylesheets/articles.scss
170
170
  - lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.eot
171
171
  - lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.ttf
@@ -206,6 +206,7 @@ files:
206
206
  - lib/generators/jinda/templates/app/assets/stylesheets/social.scss
207
207
  - lib/generators/jinda/templates/app/channels/application_cable/channel.rb
208
208
  - lib/generators/jinda/templates/app/channels/application_cable/connection.rb
209
+ - lib/generators/jinda/templates/app/controllers/api/v1/notes_controller.rb
209
210
  - lib/generators/jinda/templates/app/controllers/ctrs_controller.rb-gem-test
210
211
  - lib/generators/jinda/templates/app/controllers/jinda_org/admins_controller.rb
211
212
  - lib/generators/jinda/templates/app/controllers/jinda_org/application_controller.rb
@@ -214,6 +215,7 @@ files:
214
215
  - lib/generators/jinda/templates/app/controllers/jinda_org/devs_controller.rb
215
216
  - lib/generators/jinda/templates/app/controllers/jinda_org/identities_controller.rb
216
217
  - lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb
218
+ - lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb
217
219
  - lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
218
220
  - lib/generators/jinda/templates/app/controllers/jinda_org/password_resets_controller.rb
219
221
  - lib/generators/jinda/templates/app/controllers/jinda_org/sessions_controller.rb
@@ -234,6 +236,7 @@ files:
234
236
  - lib/generators/jinda/templates/app/jinda/template/view.html.erb
235
237
  - lib/generators/jinda/templates/app/mailers/application_mailer.rb
236
238
  - lib/generators/jinda/templates/app/mailers/jinda_mailer.rb
239
+ - lib/generators/jinda/templates/app/mailers/note_mailer.rb
237
240
  - lib/generators/jinda/templates/app/mailers/user_mailer.rb
238
241
  - lib/generators/jinda/templates/app/models/address.rb
239
242
  - lib/generators/jinda/templates/app/models/article.rb
@@ -249,12 +252,14 @@ files:
249
252
  - lib/generators/jinda/templates/app/models/jinda/runseq.rb
250
253
  - lib/generators/jinda/templates/app/models/jinda/service.rb
251
254
  - lib/generators/jinda/templates/app/models/jinda/xmain.rb
255
+ - lib/generators/jinda/templates/app/models/note.rb
252
256
  - lib/generators/jinda/templates/app/models/param.rb
253
257
  - lib/generators/jinda/templates/app/models/person.rb
254
258
  - lib/generators/jinda/templates/app/models/user.rb
255
259
  - lib/generators/jinda/templates/app/views/adminbsbs/content.haml
256
260
  - lib/generators/jinda/templates/app/views/admins/edit_role/edit_role.html.erb
257
261
  - lib/generators/jinda/templates/app/views/admins/edit_role/select_user.html.erb
262
+ - lib/generators/jinda/templates/app/views/api/v1/note.haml
258
263
  - lib/generators/jinda/templates/app/views/articles/edit.haml
259
264
  - lib/generators/jinda/templates/app/views/articles/edit_article/edit_article.html.erb
260
265
  - lib/generators/jinda/templates/app/views/articles/edit_article/select_article.html.erb
@@ -315,6 +320,19 @@ files:
315
320
  - lib/generators/jinda/templates/app/views/layouts/print.html.erb
316
321
  - lib/generators/jinda/templates/app/views/layouts/utf8.html.erb
317
322
  - lib/generators/jinda/templates/app/views/new.html.erb
323
+ - lib/generators/jinda/templates/app/views/note_mailer/gmail.html.haml
324
+ - lib/generators/jinda/templates/app/views/note_mailer/gmail.text.haml
325
+ - lib/generators/jinda/templates/app/views/notes/delete/select_note.html.erb
326
+ - lib/generators/jinda/templates/app/views/notes/edit/edit_note.html.erb
327
+ - lib/generators/jinda/templates/app/views/notes/edit/select_note.html.erb
328
+ - lib/generators/jinda/templates/app/views/notes/index.haml
329
+ - lib/generators/jinda/templates/app/views/notes/mail/display_mail.html.erb
330
+ - lib/generators/jinda/templates/app/views/notes/mail/select_note.html.erb
331
+ - lib/generators/jinda/templates/app/views/notes/mail/show.html.haml
332
+ - lib/generators/jinda/templates/app/views/notes/my.haml
333
+ - lib/generators/jinda/templates/app/views/notes/new/new_note.html.erb
334
+ - lib/generators/jinda/templates/app/views/notes/show.haml
335
+ - lib/generators/jinda/templates/app/views/notes/xedit/edit_note.html.erb
318
336
  - lib/generators/jinda/templates/app/views/password_resets/edit.html.erb
319
337
  - lib/generators/jinda/templates/app/views/password_resets/new.html.erb
320
338
  - lib/generators/jinda/templates/app/views/sessions/new.html.erb
@@ -328,7 +346,6 @@ files:
328
346
  - lib/generators/jinda/templates/config/cloudinary.yml
329
347
  - lib/generators/jinda/templates/db/seeds.rb
330
348
  - lib/generators/jinda/templates/dot/dot.env
331
- - lib/generators/jinda/templates/install.sh
332
349
  - lib/generators/jinda/templates/jinda.yml
333
350
  - lib/generators/jinda/templates/public/404.html
334
351
  - lib/generators/jinda/templates/public/422.html
@@ -336,13 +353,21 @@ files:
336
353
  - lib/generators/jinda/templates/public/assets/images/logo.png
337
354
  - lib/generators/jinda/templates/public/favicon.ico
338
355
  - lib/generators/jinda/templates/public/robots.txt
356
+ - lib/generators/jinda/templates/spec/controllers/api/v1_get_index_spec.rb
357
+ - lib/generators/jinda/templates/spec/controllers/api/v1_get_my_spec.rb
358
+ - lib/generators/jinda/templates/spec/controllers/api/v1_post_spec.rb
339
359
  - lib/generators/jinda/templates/spec/controllers/sessions_controller_spec.rb
340
360
  - lib/generators/jinda/templates/spec/features/userlogins_spec.rb
361
+ - lib/generators/jinda/templates/spec/mailers/note_spec.rb
362
+ - lib/generators/jinda/templates/spec/mailers/previews/note_preview.rb
363
+ - lib/generators/jinda/templates/spec/models/note_spec.rb
341
364
  - lib/generators/jinda/templates/spec/models/user_spec.rb
342
365
  - lib/generators/jinda/templates/spec/rails_helper.rb
343
366
  - lib/generators/jinda/templates/spec/spec_helper.rb
367
+ - lib/generators/jinda/templates/spec/support/authentication_helper.rb
344
368
  - lib/generators/jinda/templates/spec/support/factory_bot.rb
345
369
  - lib/generators/jinda/templates/spec/support/omniauth_macros.rb
370
+ - lib/generators/jinda/templates/spec/support/request_spec_helper.rb
346
371
  - lib/generators/jinda/templates/spec/views/articles/_article.html.erb_spec.rbx
347
372
  - lib/generators/jinda/templates/test/application_system_test_case.rb
348
373
  - lib/generators/jinda/templates/test/integration/jinda_routes_test.rb
@@ -1,7 +0,0 @@
1
- bundle
2
- rails g jinda:install
3
- bundle
4
- rails g jinda:config
5
- rails jinda:seed
6
- rspec
7
-