we_bridge_rails_engine_orgs 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,4 +50,26 @@ RSpec.describe OrgMember, type: :model do
50
50
  expect(res.count).to eq(0)
51
51
  end
52
52
  end
53
+
54
+ context "#text.names" do
55
+ before do
56
+ @fn = "family"
57
+ @gn = "given"
58
+ @l = Lang.create!(code: 'xx',east: true)
59
+ @member = OrgMember.create!(org_id: @org.id, entried_on: Time.now-10, retired_on: Time.now)
60
+ t = @member.text(@l.code)
61
+ t.family_name = @fn
62
+ t.given_name = @gn
63
+ t.save!
64
+ end
65
+
66
+ it "east" do
67
+ expect(@member.text(@l.code).names).to eq([@fn,@gn])
68
+ end
69
+
70
+ it "west" do
71
+ @l.update(east: false)
72
+ expect(@member.text(@l.code).names).to eq([@gn,@fn])
73
+ end
74
+ end
53
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: we_bridge_rails_engine_orgs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinjiro Itagaki
@@ -201,7 +201,6 @@ files:
201
201
  - app/assets/javascripts/org_department_positions.js
202
202
  - app/assets/javascripts/org_departments.js
203
203
  - app/assets/javascripts/org_director_types.js
204
- - app/assets/javascripts/org_directors.js
205
204
  - app/assets/javascripts/org_member_tags.js
206
205
  - app/assets/javascripts/org_member_types.js
207
206
  - app/assets/javascripts/org_members.js
@@ -211,7 +210,6 @@ files:
211
210
  - app/assets/stylesheets/org_department_positions.css
212
211
  - app/assets/stylesheets/org_departments.css
213
212
  - app/assets/stylesheets/org_director_types.css
214
- - app/assets/stylesheets/org_directors.css
215
213
  - app/assets/stylesheets/org_member_tags.css
216
214
  - app/assets/stylesheets/org_member_types.css
217
215
  - app/assets/stylesheets/org_members.css
@@ -224,7 +222,6 @@ files:
224
222
  - app/controllers/org_department_positions_controller.rb
225
223
  - app/controllers/org_departments_controller.rb
226
224
  - app/controllers/org_director_types_controller.rb
227
- - app/controllers/org_directors_controller.rb
228
225
  - app/controllers/org_member_tags_controller.rb
229
226
  - app/controllers/org_member_types_controller.rb
230
227
  - app/controllers/org_members_controller.rb
@@ -234,7 +231,6 @@ files:
234
231
  - app/helpers/org_department_positions_helper.rb
235
232
  - app/helpers/org_departments_helper.rb
236
233
  - app/helpers/org_director_types_helper.rb
237
- - app/helpers/org_directors_helper.rb
238
234
  - app/helpers/org_member_tags_helper.rb
239
235
  - app/helpers/org_member_types_helper.rb
240
236
  - app/helpers/org_members_helper.rb
@@ -296,10 +292,6 @@ files:
296
292
  - app/views/org_director_types/index.html.builder
297
293
  - app/views/org_director_types/new.html.builder
298
294
  - app/views/org_director_types/show.html.builder
299
- - app/views/org_directors/edit.html.builder
300
- - app/views/org_directors/index.html.builder
301
- - app/views/org_directors/new.html.builder
302
- - app/views/org_directors/show.html.builder
303
295
  - app/views/org_member_tags/edit.html.builder
304
296
  - app/views/org_member_tags/index.html.builder
305
297
  - app/views/org_member_tags/new.html.builder
@@ -339,7 +331,6 @@ files:
339
331
  - spec/controllers/org_department_positions_controller_spec.rb
340
332
  - spec/controllers/org_departments_controller_spec.rb
341
333
  - spec/controllers/org_director_types_controller_spec.rb
342
- - spec/controllers/org_directors_controller_spec.rb
343
334
  - spec/controllers/org_member_tags_controller_spec.rb
344
335
  - spec/controllers/org_member_types_controller_spec.rb
345
336
  - spec/controllers/org_members_controller_spec.rb
@@ -498,7 +489,6 @@ files:
498
489
  - spec/factories/org_department_positions.rb
499
490
  - spec/factories/org_departments.rb
500
491
  - spec/factories/org_director_types.rb
501
- - spec/factories/org_directors.rb
502
492
  - spec/factories/org_member_tags.rb
503
493
  - spec/factories/org_member_types.rb
504
494
  - spec/factories/org_members.rb
@@ -508,7 +498,6 @@ files:
508
498
  - spec/helpers/org_department_positions_helper_spec.rb
509
499
  - spec/helpers/org_departments_helper_spec.rb
510
500
  - spec/helpers/org_director_types_helper_spec.rb
511
- - spec/helpers/org_directors_helper_spec.rb
512
501
  - spec/helpers/org_member_tags_helper_spec.rb
513
502
  - spec/helpers/org_member_types_helper_spec.rb
514
503
  - spec/helpers/org_members_helper_spec.rb
@@ -529,7 +518,6 @@ files:
529
518
  - spec/routing/org_department_positions_routing_spec.rb
530
519
  - spec/routing/org_departments_routing_spec.rb
531
520
  - spec/routing/org_director_types_routing_spec.rb
532
- - spec/routing/org_directors_routing_spec.rb
533
521
  - spec/routing/org_member_tags_routing_spec.rb
534
522
  - spec/routing/org_member_types_routing_spec.rb
535
523
  - spec/routing/org_members_routing_spec.rb
@@ -555,10 +543,6 @@ files:
555
543
  - spec/views/org_director_types/index.html.builder_spec.rb
556
544
  - spec/views/org_director_types/new.html.builder_spec.rb
557
545
  - spec/views/org_director_types/show.html.builder_spec.rb
558
- - spec/views/org_directors/edit.html.builder_spec.rb
559
- - spec/views/org_directors/index.html.builder_spec.rb
560
- - spec/views/org_directors/new.html.builder_spec.rb
561
- - spec/views/org_directors/show.html.builder_spec.rb
562
546
  - spec/views/org_member_tags/edit.html.builder_spec.rb
563
547
  - spec/views/org_member_tags/index.html.builder_spec.rb
564
548
  - spec/views/org_member_tags/new.html.builder_spec.rb
@@ -607,7 +591,6 @@ test_files:
607
591
  - spec/controllers/org_department_positions_controller_spec.rb
608
592
  - spec/controllers/org_departments_controller_spec.rb
609
593
  - spec/controllers/org_director_types_controller_spec.rb
610
- - spec/controllers/org_directors_controller_spec.rb
611
594
  - spec/controllers/org_member_tags_controller_spec.rb
612
595
  - spec/controllers/org_member_types_controller_spec.rb
613
596
  - spec/controllers/org_members_controller_spec.rb
@@ -766,7 +749,6 @@ test_files:
766
749
  - spec/factories/org_department_positions.rb
767
750
  - spec/factories/org_departments.rb
768
751
  - spec/factories/org_director_types.rb
769
- - spec/factories/org_directors.rb
770
752
  - spec/factories/org_member_tags.rb
771
753
  - spec/factories/org_member_types.rb
772
754
  - spec/factories/org_members.rb
@@ -776,7 +758,6 @@ test_files:
776
758
  - spec/helpers/org_department_positions_helper_spec.rb
777
759
  - spec/helpers/org_departments_helper_spec.rb
778
760
  - spec/helpers/org_director_types_helper_spec.rb
779
- - spec/helpers/org_directors_helper_spec.rb
780
761
  - spec/helpers/org_member_tags_helper_spec.rb
781
762
  - spec/helpers/org_member_types_helper_spec.rb
782
763
  - spec/helpers/org_members_helper_spec.rb
@@ -797,7 +778,6 @@ test_files:
797
778
  - spec/routing/org_department_positions_routing_spec.rb
798
779
  - spec/routing/org_departments_routing_spec.rb
799
780
  - spec/routing/org_director_types_routing_spec.rb
800
- - spec/routing/org_directors_routing_spec.rb
801
781
  - spec/routing/org_member_tags_routing_spec.rb
802
782
  - spec/routing/org_member_types_routing_spec.rb
803
783
  - spec/routing/org_members_routing_spec.rb
@@ -823,10 +803,6 @@ test_files:
823
803
  - spec/views/org_director_types/index.html.builder_spec.rb
824
804
  - spec/views/org_director_types/new.html.builder_spec.rb
825
805
  - spec/views/org_director_types/show.html.builder_spec.rb
826
- - spec/views/org_directors/edit.html.builder_spec.rb
827
- - spec/views/org_directors/index.html.builder_spec.rb
828
- - spec/views/org_directors/new.html.builder_spec.rb
829
- - spec/views/org_directors/show.html.builder_spec.rb
830
806
  - spec/views/org_member_tags/edit.html.builder_spec.rb
831
807
  - spec/views/org_member_tags/index.html.builder_spec.rb
832
808
  - spec/views/org_member_tags/new.html.builder_spec.rb
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,5 +0,0 @@
1
- class OrgDirectorsController < ApplicationController
2
- include WeBridge::AutoViewHelper::Controller
3
- set_model OrgDirector
4
- include OrgCommon
5
- end
@@ -1,2 +0,0 @@
1
- module OrgDirectorsHelper
2
- end
@@ -1 +0,0 @@
1
- render('common/edit')
@@ -1 +0,0 @@
1
- render('common/index')
@@ -1 +0,0 @@
1
- render('common/new')
@@ -1 +0,0 @@
1
- render('common/show')
@@ -1,159 +0,0 @@
1
- require 'rails_helper'
2
-
3
- # This spec was generated by rspec-rails when you ran the scaffold generator.
4
- # It demonstrates how one might use RSpec to specify the controller code that
5
- # was generated by Rails when you ran the scaffold generator.
6
- #
7
- # It assumes that the implementation code is generated by the rails scaffold
8
- # generator. If you are using any extension libraries to generate different
9
- # controller code, this generated spec may or may not pass.
10
- #
11
- # It only uses APIs available in rails and/or rspec-rails. There are a number
12
- # of tools you can use to make these specs even more expressive, but we're
13
- # sticking to rails and rspec-rails APIs to keep things simple and stable.
14
- #
15
- # Compared to earlier versions of this generator, there is very limited use of
16
- # stubs and message expectations in this spec. Stubs are only used when there
17
- # is no simpler way to get a handle on the object needed for the example.
18
- # Message expectations are only used when there is no simpler way to specify
19
- # that an instance is receiving a specific message.
20
-
21
- RSpec.describe OrgDirectorsController, type: :controller do
22
-
23
- # This should return the minimal set of attributes required to create a valid
24
- # OrgDirector. As you add validations to OrgDirector, be sure to
25
- # adjust the attributes here as well.
26
- let(:valid_attributes) {
27
- skip("Add a hash of attributes valid for your model")
28
- }
29
-
30
- let(:invalid_attributes) {
31
- skip("Add a hash of attributes invalid for your model")
32
- }
33
-
34
- # This should return the minimal set of values that should be in the session
35
- # in order to pass any filters (e.g. authentication) defined in
36
- # OrgDirectorsController. Be sure to keep this updated too.
37
- let(:valid_session) { {} }
38
-
39
- describe "GET #index" do
40
- it "assigns all org_directors as @org_directors" do
41
- org_director = OrgDirector.create! valid_attributes
42
- get :index, {}, valid_session
43
- expect(assigns(:org_directors)).to eq([org_director])
44
- end
45
- end
46
-
47
- describe "GET #show" do
48
- it "assigns the requested org_director as @org_director" do
49
- org_director = OrgDirector.create! valid_attributes
50
- get :show, {:id => org_director.to_param}, valid_session
51
- expect(assigns(:org_director)).to eq(org_director)
52
- end
53
- end
54
-
55
- describe "GET #new" do
56
- it "assigns a new org_director as @org_director" do
57
- get :new, {}, valid_session
58
- expect(assigns(:org_director)).to be_a_new(OrgDirector)
59
- end
60
- end
61
-
62
- describe "GET #edit" do
63
- it "assigns the requested org_director as @org_director" do
64
- org_director = OrgDirector.create! valid_attributes
65
- get :edit, {:id => org_director.to_param}, valid_session
66
- expect(assigns(:org_director)).to eq(org_director)
67
- end
68
- end
69
-
70
- describe "POST #create" do
71
- context "with valid params" do
72
- it "creates a new OrgDirector" do
73
- expect {
74
- post :create, {:org_director => valid_attributes}, valid_session
75
- }.to change(OrgDirector, :count).by(1)
76
- end
77
-
78
- it "assigns a newly created org_director as @org_director" do
79
- post :create, {:org_director => valid_attributes}, valid_session
80
- expect(assigns(:org_director)).to be_a(OrgDirector)
81
- expect(assigns(:org_director)).to be_persisted
82
- end
83
-
84
- it "redirects to the created org_director" do
85
- post :create, {:org_director => valid_attributes}, valid_session
86
- expect(response).to redirect_to(OrgDirector.last)
87
- end
88
- end
89
-
90
- context "with invalid params" do
91
- it "assigns a newly created but unsaved org_director as @org_director" do
92
- post :create, {:org_director => invalid_attributes}, valid_session
93
- expect(assigns(:org_director)).to be_a_new(OrgDirector)
94
- end
95
-
96
- it "re-renders the 'new' template" do
97
- post :create, {:org_director => invalid_attributes}, valid_session
98
- expect(response).to render_template("new")
99
- end
100
- end
101
- end
102
-
103
- describe "PUT #update" do
104
- context "with valid params" do
105
- let(:new_attributes) {
106
- skip("Add a hash of attributes valid for your model")
107
- }
108
-
109
- it "updates the requested org_director" do
110
- org_director = OrgDirector.create! valid_attributes
111
- put :update, {:id => org_director.to_param, :org_director => new_attributes}, valid_session
112
- org_director.reload
113
- skip("Add assertions for updated state")
114
- end
115
-
116
- it "assigns the requested org_director as @org_director" do
117
- org_director = OrgDirector.create! valid_attributes
118
- put :update, {:id => org_director.to_param, :org_director => valid_attributes}, valid_session
119
- expect(assigns(:org_director)).to eq(org_director)
120
- end
121
-
122
- it "redirects to the org_director" do
123
- org_director = OrgDirector.create! valid_attributes
124
- put :update, {:id => org_director.to_param, :org_director => valid_attributes}, valid_session
125
- expect(response).to redirect_to(org_director)
126
- end
127
- end
128
-
129
- context "with invalid params" do
130
- it "assigns the org_director as @org_director" do
131
- org_director = OrgDirector.create! valid_attributes
132
- put :update, {:id => org_director.to_param, :org_director => invalid_attributes}, valid_session
133
- expect(assigns(:org_director)).to eq(org_director)
134
- end
135
-
136
- it "re-renders the 'edit' template" do
137
- org_director = OrgDirector.create! valid_attributes
138
- put :update, {:id => org_director.to_param, :org_director => invalid_attributes}, valid_session
139
- expect(response).to render_template("edit")
140
- end
141
- end
142
- end
143
-
144
- describe "DELETE #destroy" do
145
- it "destroys the requested org_director" do
146
- org_director = OrgDirector.create! valid_attributes
147
- expect {
148
- delete :destroy, {:id => org_director.to_param}, valid_session
149
- }.to change(OrgDirector, :count).by(-1)
150
- end
151
-
152
- it "redirects to the org_directors list" do
153
- org_director = OrgDirector.create! valid_attributes
154
- delete :destroy, {:id => org_director.to_param}, valid_session
155
- expect(response).to redirect_to(org_directors_url)
156
- end
157
- end
158
-
159
- end
@@ -1,6 +0,0 @@
1
- FactoryGirl.define do
2
- factory :org_director do
3
-
4
- end
5
-
6
- end
@@ -1,15 +0,0 @@
1
- require 'rails_helper'
2
-
3
- # Specs in this file have access to a helper object that includes
4
- # the OrgDirectorsHelper. For example:
5
- #
6
- # describe OrgDirectorsHelper do
7
- # describe "string concat" do
8
- # it "concats two strings with spaces" do
9
- # expect(helper.concat_strings("this","that")).to eq("this that")
10
- # end
11
- # end
12
- # end
13
- RSpec.describe OrgDirectorsHelper, type: :helper do
14
- pending "add some examples to (or delete) #{__FILE__}"
15
- end
@@ -1,39 +0,0 @@
1
- require "rails_helper"
2
-
3
- RSpec.describe OrgDirectorsController, type: :routing do
4
- describe "routing" do
5
-
6
- it "routes to #index" do
7
- expect(:get => "/org_directors").to route_to("org_directors#index")
8
- end
9
-
10
- it "routes to #new" do
11
- expect(:get => "/org_directors/new").to route_to("org_directors#new")
12
- end
13
-
14
- it "routes to #show" do
15
- expect(:get => "/org_directors/1").to route_to("org_directors#show", :id => "1")
16
- end
17
-
18
- it "routes to #edit" do
19
- expect(:get => "/org_directors/1/edit").to route_to("org_directors#edit", :id => "1")
20
- end
21
-
22
- it "routes to #create" do
23
- expect(:post => "/org_directors").to route_to("org_directors#create")
24
- end
25
-
26
- it "routes to #update via PUT" do
27
- expect(:put => "/org_directors/1").to route_to("org_directors#update", :id => "1")
28
- end
29
-
30
- it "routes to #update via PATCH" do
31
- expect(:patch => "/org_directors/1").to route_to("org_directors#update", :id => "1")
32
- end
33
-
34
- it "routes to #destroy" do
35
- expect(:delete => "/org_directors/1").to route_to("org_directors#destroy", :id => "1")
36
- end
37
-
38
- end
39
- end
@@ -1,14 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe "org_directors/edit", type: :view do
4
- before(:each) do
5
- @org_director = assign(:org_director, OrgDirector.create!())
6
- end
7
-
8
- it "renders the edit org_director form" do
9
- render
10
-
11
- assert_select "form[action=?][method=?]", org_director_path(@org_director), "post" do
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe "org_directors/index", type: :view do
4
- before(:each) do
5
- assign(:org_directors, [
6
- OrgDirector.create!(),
7
- OrgDirector.create!()
8
- ])
9
- end
10
-
11
- it "renders a list of org_directors" do
12
- render
13
- end
14
- end