customer_vault 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +2 -2
- data/app/assets/images/customer_vault/icons/group-128.png +0 -0
- data/app/assets/images/customer_vault/icons/group-16.png +0 -0
- data/app/assets/images/customer_vault/icons/group-20.png +0 -0
- data/app/assets/images/customer_vault/icons/group-24.png +0 -0
- data/app/assets/images/customer_vault/icons/group-256.png +0 -0
- data/app/assets/images/customer_vault/icons/group-32.png +0 -0
- data/app/assets/images/customer_vault/icons/group-48.png +0 -0
- data/app/assets/images/customer_vault/icons/group-512.png +0 -0
- data/app/assets/images/customer_vault/icons/group-64.png +0 -0
- data/app/assets/stylesheets/customer_vault/{application.css → application.css.scss} +54 -5
- data/app/assets/stylesheets/customer_vault/{people.css → individuals.css} +1 -0
- data/app/assets/stylesheets/customer_vault/links.css +3 -0
- data/app/controllers/customer_vault/corporations_controller.rb +5 -7
- data/app/controllers/customer_vault/individuals_controller.rb +61 -0
- data/app/controllers/customer_vault/links_controller.rb +53 -0
- data/app/controllers/customer_vault/people_controller.rb +5 -54
- data/app/helpers/customer_vault/individuals_helper.rb +4 -0
- data/app/models/customer_vault/corporation.rb +5 -1
- data/app/models/customer_vault/individual.rb +15 -0
- data/app/models/customer_vault/link.rb +6 -0
- data/app/models/customer_vault/person.rb +13 -2
- data/app/views/customer_vault/corporations/_form.html.slim +28 -21
- data/app/views/customer_vault/corporations/_list_details.html.slim +29 -0
- data/app/views/customer_vault/corporations/_show_details.html.slim +36 -0
- data/app/views/customer_vault/corporations/edit.html.slim +22 -7
- data/app/views/customer_vault/corporations/new.html.slim +22 -5
- data/app/views/customer_vault/corporations/show.html.slim +41 -16
- data/app/views/customer_vault/{people → individuals}/_form.html.slim +16 -13
- data/app/views/customer_vault/individuals/_list_details.html.slim +39 -0
- data/app/views/customer_vault/individuals/_show_details.html.slim +52 -0
- data/app/views/customer_vault/individuals/edit.html.slim +23 -0
- data/app/views/customer_vault/individuals/new.html.slim +25 -0
- data/app/views/customer_vault/individuals/show.html.slim +42 -0
- data/app/views/customer_vault/layout/_form_error.html.slim +5 -0
- data/app/views/customer_vault/links/_aside.html.slim +4 -0
- data/app/views/customer_vault/links/_title.html.slim +3 -0
- data/app/views/customer_vault/links/edit.html.slim +30 -0
- data/app/views/customer_vault/links/new.html.slim +32 -0
- data/app/views/customer_vault/people/_select.html.slim +1 -0
- data/app/views/customer_vault/people/index.html.slim +29 -58
- data/config/cucumber.yml +8 -0
- data/config/routes.rb +7 -3
- data/db/migrate/20141016151955_change_people_to_individuals.rb +5 -0
- data/db/migrate/20141017085621_add_link.rb +12 -0
- data/lib/customer_vault/engine.rb +1 -0
- data/lib/customer_vault/version.rb +1 -1
- data/lib/tasks/cucumber.rake +65 -0
- data/spec/controllers/customer_vault/corporations_controller_spec.rb +3 -9
- data/spec/controllers/customer_vault/individuals_controller_spec.rb +156 -0
- data/spec/dummy/config/initializers/inflections.rb +1 -1
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20141013153526_create_dorsale_addresses.dorsale.rb +14 -0
- data/spec/dummy/db/migrate/20141014073225_add_polymorphic_fields_to_addresses.dorsale.rb +7 -0
- data/spec/dummy/db/schema.rb +24 -2
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +22059 -0
- data/spec/dummy/log/test.log +35561 -0
- data/spec/dummy/tmp/cache/assets/development/sass/8f425af8af5194cec6da5008411d913407b2b024/application.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/03c4e7aa08d7d8a9e984a1e4eea01566 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/190ff82deecfbbe385c03ee8f8f3d2bf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/201cb9b3ce55f2f4dea6232ab8220cc3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2de61d7dd16d9e661790bc2973cc609a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/34d14962fde7e4fd6e2671844bcfaa78 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/39c67f2e186cde8355bb4533f16da267 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/47170c4182a8457e8d53507ea76fa76b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/471d75c3acc9522efc857f3be05b8375 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/49ff98533b89b4c09d5d1ecb9d45f207 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4b15ccd40e1d9deecfe3f523edb32a25 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4cd6d71a32c5da916328bfcfa972bd6c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5d0e775359a27eb80c837eee1bdd52cb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6355dea7c574d08602bd4e7e16a4c0d2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6847fabb2f2a2ff6011d957adb14a11e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/78ef508640527d1bb135c1077223fb7c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8e1929049a5ed5974d9bbb22b2c1bbc4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/92220e9fcf5e0717b9dc27169bf512e9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a774486cb0f2787691a7e585e008caea +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/aa60fba48cd1c25f138255570918b3db +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ac788eb47a519e5f2837cf9504d74f53 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ac8cf41eb80a554f4f15e80fa6e1ea58 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/df9e45a4bc905f29f8544c37dc9e9a18 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e5782a71fc01b88e6ac0c1c963bf7e3e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f516186931f15a3e5c86af1b1632d256 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/faca8abcf70e21e966cebb74604b729f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/8f425af8af5194cec6da5008411d913407b2b024/application.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/03c4e7aa08d7d8a9e984a1e4eea01566 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0e2a9601926844c961e7e97d32e775be +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/183bdc6b3ba504dc16e7b94a0f38fe06 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/190ff82deecfbbe385c03ee8f8f3d2bf +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1dc5cb7209fcdb172bfcde9c841c19e3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/201cb9b3ce55f2f4dea6232ab8220cc3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2b9d45522b3d1f3105e1c33e325dc6de +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2df425d43fef5663aadfc1bcc3087066 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2e7625733abd8050be92fe0ca1487fad +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/31876fc299b61887fae3e657773d7b15 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/338e8df8f4119a2a48b920613a8026a9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/34d14962fde7e4fd6e2671844bcfaa78 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/36adb34aba0d7825a4c9a4cf09c33572 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/39c67f2e186cde8355bb4533f16da267 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/40dbaa1db791d7be2279ddd67d33a1c4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/47170c4182a8457e8d53507ea76fa76b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/471d75c3acc9522efc857f3be05b8375 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/49ff98533b89b4c09d5d1ecb9d45f207 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4b15ccd40e1d9deecfe3f523edb32a25 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4cd6d71a32c5da916328bfcfa972bd6c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4d0235c7b6e465a89ad270537681be7f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/52f82b29641b7e97fabca983410c944d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5b95ef84d5ea3822d0364f3a6f5fa9ff +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5bc4ad6e6b955197190847aeff8df8bd +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5d0e775359a27eb80c837eee1bdd52cb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6355dea7c574d08602bd4e7e16a4c0d2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/67a7734fae2f02d979ee498add75d3eb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6847fabb2f2a2ff6011d957adb14a11e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/78ef508640527d1bb135c1077223fb7c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/86a049860d05103d78ab689003d6ccb3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8e1929049a5ed5974d9bbb22b2c1bbc4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/92220e9fcf5e0717b9dc27169bf512e9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a5c73696137ab9dbdda376c8d7ffa3b9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a8e30d24c0bb5789981c4751cd2cdd76 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ac788eb47a519e5f2837cf9504d74f53 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ac8cf41eb80a554f4f15e80fa6e1ea58 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b10f86698e41bfdaafc9fb6bbf5bfbd9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c08aad292c2ca4aee63f927a45ba90ef +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c9db74506cdab0aec9f855c956f47726 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d04aeffd159aa29e71a9770dc8630259 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/db5f1ec4fd27d454a95b2824fff064d1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/df9e45a4bc905f29f8544c37dc9e9a18 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e5782a71fc01b88e6ac0c1c963bf7e3e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f516186931f15a3e5c86af1b1632d256 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/faca8abcf70e21e966cebb74604b729f +0 -0
- data/spec/dummy/tmp/capybara/capybara-201410171416122395182759.html +13 -0
- data/spec/factories/customer_vault_corporations.rb +4 -4
- data/spec/factories/{customer_vault_people.rb → customer_vault_individuals.rb} +1 -1
- data/spec/factories/customer_vault_links.rb +9 -0
- data/spec/helpers/customer_vault/{people_helper_spec.rb → individuals_helper_spec.rb} +3 -3
- data/spec/models/customer_vault/corporation_spec.rb +1 -0
- data/spec/models/customer_vault/individual_spec.rb +15 -0
- data/spec/models/customer_vault/link_spec.rb +13 -0
- data/spec/models/customer_vault/person_spec.rb +28 -6
- data/spec/routing/customer_vault/corporations_routing_spec.rb +22 -4
- data/spec/routing/customer_vault/individual_routing_spec.rb +54 -0
- data/spec/routing/customer_vault/people_routing_spec.rb +1 -26
- data/spec/spec_helper.rb +1 -0
- data/spec/views/customer_vault/individuals/edit.html.slim_spec.rb +47 -0
- data/spec/views/customer_vault/individuals/new.html.slim_spec.rb +47 -0
- data/spec/views/customer_vault/{people → individuals}/show.html.slim_spec.rb +2 -3
- metadata +226 -49
- data/app/assets/images/customer_vault/icons/add_person-128.png +0 -0
- data/app/assets/images/customer_vault/icons/add_person-20.png +0 -0
- data/app/assets/images/customer_vault/icons/add_person-24.png +0 -0
- data/app/assets/images/customer_vault/icons/add_person-256.png +0 -0
- data/app/assets/images/customer_vault/icons/add_person-32.png +0 -0
- data/app/assets/images/customer_vault/icons/add_person-48.png +0 -0
- data/app/assets/images/customer_vault/icons/add_person-512.png +0 -0
- data/app/assets/images/customer_vault/icons/add_person-64.png +0 -0
- data/app/helpers/customer_vault/people_helper.rb +0 -12
- data/app/views/customer_vault/corporations/index.html.slim +0 -27
- data/app/views/customer_vault/people/edit.html.slim +0 -21
- data/app/views/customer_vault/people/new.html.slim +0 -21
- data/app/views/customer_vault/people/show.html.slim +0 -57
- data/spec/controllers/customer_vault/people_controller_spec.rb +0 -163
- data/spec/views/customer_vault/corporations/index.html.slim_spec.rb +0 -29
- data/spec/views/customer_vault/people/edit.html.slim_spec.rb +0 -47
- data/spec/views/customer_vault/people/index.html.slim_spec.rb +0 -43
- data/spec/views/customer_vault/people/new.html.slim_spec.rb +0 -47
- /data/app/assets/images/customer_vault/icons/{people-128.png → individual-128.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-16.png → individual-16.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-20.png → individual-20.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-24.png → individual-24.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-256.png → individual-256.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-32.png → individual-32.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-48.png → individual-48.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-512.png → individual-512.png} +0 -0
- /data/app/assets/images/customer_vault/icons/{people-64.png → individual-64.png} +0 -0
- /data/app/assets/javascripts/customer_vault/{people.js → individuals.js} +0 -0
@@ -1,57 +0,0 @@
|
|
1
|
-
.container-fluid
|
2
|
-
.col-lg-12
|
3
|
-
ol class="breadcrumb"
|
4
|
-
li
|
5
|
-
= link_to 'Home', '/'
|
6
|
-
li
|
7
|
-
= link_to 'People', customer_vault.people_path
|
8
|
-
li.active #{@person.first_name} #{@person.last_name}
|
9
|
-
.col-lg-12
|
10
|
-
.col-lg-4
|
11
|
-
aside class = "col-lg-12 cadre"
|
12
|
-
.row
|
13
|
-
.col-lg-12.cdiv
|
14
|
-
=image_tag ('customer_vault/icons/people-64.png')
|
15
|
-
.col-lg-12.cdiv
|
16
|
-
span class= "text-muted titre bold" #{@person.title} #{@person.first_name} #{@person.last_name}
|
17
|
-
.row
|
18
|
-
.col-lg-12.top-buffer
|
19
|
-
- if @person.email?
|
20
|
-
.col-lg-12.cdiv
|
21
|
-
.bold.text-muted.cdiv Email
|
22
|
-
span #{@person.email}
|
23
|
-
.col-lg-12.cdiv
|
24
|
-
- if @person.twitter?
|
25
|
-
.bold.text-muted.cdiv Twitter
|
26
|
-
span #{@person.twitter}
|
27
|
-
.col-lg-12.cdiv
|
28
|
-
- if @person.phone?
|
29
|
-
.bold.text-muted.cdiv Phone
|
30
|
-
span #{@person.phone}
|
31
|
-
.col-lg-12.cdiv
|
32
|
-
- if @person.mobile?
|
33
|
-
.bold.text-muted.cdiv Mobile
|
34
|
-
span #{@person.mobile}
|
35
|
-
.col-lg-12.cdiv
|
36
|
-
- if @person.fax?
|
37
|
-
.bold.text-muted.cdiv Fax
|
38
|
-
span #{@person.fax}
|
39
|
-
.col-lg-12.cdiv
|
40
|
-
- if @person.context?
|
41
|
-
.bold.text-muted.cdiv Context
|
42
|
-
span #{@person.context}
|
43
|
-
.col-lg-12.cdiv
|
44
|
-
- if @person.www?
|
45
|
-
.bold.text-muted.cdiv Internet Site
|
46
|
-
=link_to @person.www , extlink(@person.www)
|
47
|
-
|
48
|
-
.row.mega-top-buffer.bottom-buffer
|
49
|
-
.col-lg-4.cdiv
|
50
|
-
=link_to 'Editer', customer_vault.edit_person_path(@person), :class=>"btn btn-success btn-sm"
|
51
|
-
.col-lg-4.cdiv
|
52
|
-
=link_to 'Effacer', [customer_vault, @person], data: {:confirm => 'Are you sure?'}, :method => :delete, :class=>"btn btn-danger btn-sm"
|
53
|
-
.col-lg-4.cdiv
|
54
|
-
= link_to 'Retour', customer_vault.people_path, :class=>"btn btn-primary btn-sm"
|
55
|
-
.col-lg-8
|
56
|
-
.col-lg-12
|
57
|
-
|
@@ -1,163 +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
|
-
module CustomerVault
|
22
|
-
RSpec.describe PeopleController, :type => :controller do
|
23
|
-
|
24
|
-
routes { CustomerVault::Engine.routes }
|
25
|
-
|
26
|
-
# This should return the minimal set of attributes required to create a valid
|
27
|
-
# Person. As you add validations to Person, be sure to
|
28
|
-
# adjust the attributes here as well.
|
29
|
-
let(:valid_attributes) {
|
30
|
-
FactoryGirl.attributes_for(:customer_vault_person)
|
31
|
-
}
|
32
|
-
|
33
|
-
let(:invalid_attributes) {
|
34
|
-
{ last_name: "" }
|
35
|
-
}
|
36
|
-
|
37
|
-
# This should return the minimal set of values that should be in the session
|
38
|
-
# in order to pass any filters (e.g. authentication) defined in
|
39
|
-
# PeopleController. Be sure to keep this updated too.
|
40
|
-
let(:valid_session) { {} }
|
41
|
-
|
42
|
-
describe "GET index" do
|
43
|
-
it "assigns all people as @people" do
|
44
|
-
person = Person.create! valid_attributes
|
45
|
-
get :index, {}, valid_session
|
46
|
-
expect(assigns(:people)).to eq([person])
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe "GET show" do
|
51
|
-
it "assigns the requested person as @person" do
|
52
|
-
person = Person.create! valid_attributes
|
53
|
-
get :show, {:id => person.to_param, :use_route => :customer_vault}, valid_session
|
54
|
-
expect(assigns(:person)).to eq(person)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe "GET new" do
|
59
|
-
it "assigns a new person as @person" do
|
60
|
-
get :new, {}, valid_session
|
61
|
-
expect(assigns(:person)).to be_a_new(Person)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
describe "GET edit" do
|
66
|
-
it "assigns the requested person as @person" do
|
67
|
-
person = Person.create! valid_attributes
|
68
|
-
get :edit, {:id => person.to_param}, valid_session
|
69
|
-
expect(assigns(:person)).to eq(person)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "POST create" do
|
74
|
-
describe "with valid params" do
|
75
|
-
it "creates a new Person" do
|
76
|
-
expect {
|
77
|
-
post :create, {:person => valid_attributes}, valid_session
|
78
|
-
}.to change(Person, :count).by(1)
|
79
|
-
end
|
80
|
-
|
81
|
-
it "assigns a newly created person as @person" do
|
82
|
-
post :create, {:person => valid_attributes}, valid_session
|
83
|
-
expect(assigns(:person)).to be_a(Person)
|
84
|
-
expect(assigns(:person)).to be_persisted
|
85
|
-
end
|
86
|
-
|
87
|
-
it "redirects to the created person" do
|
88
|
-
post :create, {:person => valid_attributes}, valid_session
|
89
|
-
expect(response).to redirect_to(Person.last)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe "with invalid params" do
|
94
|
-
it "assigns a newly created but unsaved person as @person" do
|
95
|
-
post :create, {:person => invalid_attributes}, valid_session
|
96
|
-
expect(assigns(:person)).to be_a_new(Person)
|
97
|
-
end
|
98
|
-
|
99
|
-
it "re-renders the 'new' template" do
|
100
|
-
post :create, {:person => invalid_attributes}, valid_session
|
101
|
-
expect(response).to render_template("new")
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
describe "PUT update" do
|
107
|
-
describe "with valid params" do
|
108
|
-
let(:new_attributes) {
|
109
|
-
{first_name: "Stroumph"}
|
110
|
-
}
|
111
|
-
|
112
|
-
it "updates the requested person" do
|
113
|
-
person = Person.create! valid_attributes
|
114
|
-
put :update, {:id => person.to_param, :person => new_attributes}, valid_session
|
115
|
-
person.reload
|
116
|
-
expect(person.first_name).to eq("Stroumph")
|
117
|
-
end
|
118
|
-
|
119
|
-
it "assigns the requested person as @person" do
|
120
|
-
person = Person.create! valid_attributes
|
121
|
-
put :update, {:id => person.to_param, :person => valid_attributes}, valid_session
|
122
|
-
expect(assigns(:person)).to eq(person)
|
123
|
-
end
|
124
|
-
|
125
|
-
it "redirects to the person" do
|
126
|
-
person = Person.create! valid_attributes
|
127
|
-
put :update, {:id => person.to_param, :person => valid_attributes}, valid_session
|
128
|
-
expect(response).to redirect_to(person)
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
describe "with invalid params" do
|
133
|
-
it "assigns the person as @person" do
|
134
|
-
person = Person.create! valid_attributes
|
135
|
-
put :update, {:id => person.to_param, :person => invalid_attributes}, valid_session
|
136
|
-
expect(assigns(:person)).to eq(person)
|
137
|
-
end
|
138
|
-
|
139
|
-
it "re-renders the 'edit' template" do
|
140
|
-
person = Person.create! valid_attributes
|
141
|
-
put :update, {:id => person.to_param, :person => invalid_attributes}, valid_session
|
142
|
-
expect(response).to render_template("edit")
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
describe "DELETE destroy" do
|
148
|
-
it "destroys the requested person" do
|
149
|
-
person = Person.create! valid_attributes
|
150
|
-
expect {
|
151
|
-
delete :destroy, {:id => person.to_param}, valid_session
|
152
|
-
}.to change(Person, :count).by(-1)
|
153
|
-
end
|
154
|
-
|
155
|
-
it "redirects to the people list" do
|
156
|
-
person = Person.create! valid_attributes
|
157
|
-
delete :destroy, {:id => person.to_param}, valid_session
|
158
|
-
expect(response).to redirect_to(people_url)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
end
|
163
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
module CustomerVault
|
3
|
-
RSpec.describe "customer_vault/corporations/index", :type => :view do
|
4
|
-
before(:each) do
|
5
|
-
assign(:corporations, [
|
6
|
-
Corporation.create!(
|
7
|
-
:name => "Name",
|
8
|
-
:email => "Email",
|
9
|
-
:phone => "Phone",
|
10
|
-
:fax => "Fax"
|
11
|
-
),
|
12
|
-
Corporation.create!(
|
13
|
-
:name => "Name",
|
14
|
-
:email => "Email",
|
15
|
-
:phone => "Phone",
|
16
|
-
:fax => "Fax"
|
17
|
-
)
|
18
|
-
])
|
19
|
-
end
|
20
|
-
|
21
|
-
it "renders a list of corporations" do
|
22
|
-
render
|
23
|
-
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
24
|
-
assert_select "tr>td", :text => "Email".to_s, :count => 2
|
25
|
-
assert_select "tr>td", :text => "Phone".to_s, :count => 2
|
26
|
-
assert_select "tr>td", :text => "Fax".to_s, :count => 2
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
module CustomerVault
|
4
|
-
RSpec.describe "customer_vault/people/edit", :type => :view do
|
5
|
-
before(:each) do
|
6
|
-
@person = assign(:person, Person.create!(
|
7
|
-
:first_name => "MyString",
|
8
|
-
:last_name => "MyString",
|
9
|
-
:email => "MyString",
|
10
|
-
:title => "MyString",
|
11
|
-
:twitter => "MyString",
|
12
|
-
:www => "MyString",
|
13
|
-
:context => "MyText",
|
14
|
-
:phone => "MyString",
|
15
|
-
:fax => "MyString",
|
16
|
-
:mobile => "MyString"
|
17
|
-
))
|
18
|
-
end
|
19
|
-
|
20
|
-
it "renders the edit person form" do
|
21
|
-
render
|
22
|
-
|
23
|
-
assert_select "form[action=?][method=?]", customer_vault.person_path(@person), "post" do
|
24
|
-
|
25
|
-
assert_select "input#person_first_name[name=?]", "person[first_name]"
|
26
|
-
|
27
|
-
assert_select "input#person_last_name[name=?]", "person[last_name]"
|
28
|
-
|
29
|
-
assert_select "input#person_email[name=?]", "person[email]"
|
30
|
-
|
31
|
-
assert_select "input#person_title[name=?]", "person[title]"
|
32
|
-
|
33
|
-
assert_select "input#person_twitter[name=?]", "person[twitter]"
|
34
|
-
|
35
|
-
assert_select "input#person_www[name=?]", "person[www]"
|
36
|
-
|
37
|
-
assert_select "textarea#person_context[name=?]", "person[context]"
|
38
|
-
|
39
|
-
assert_select "input#person_phone[name=?]", "person[phone]"
|
40
|
-
|
41
|
-
assert_select "input#person_fax[name=?]", "person[fax]"
|
42
|
-
|
43
|
-
assert_select "input#person_mobile[name=?]", "person[mobile]"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
module CustomerVault
|
3
|
-
RSpec.describe "customer_vault/people/index", :type => :view do
|
4
|
-
before(:each) do
|
5
|
-
assign(:people, [
|
6
|
-
Person.create!(
|
7
|
-
:first_name => "First Name",
|
8
|
-
:last_name => "Last Name",
|
9
|
-
:email => "Email",
|
10
|
-
:title => "Title",
|
11
|
-
:twitter => "Twitter",
|
12
|
-
:www => "Www",
|
13
|
-
:context => "MyText",
|
14
|
-
:phone => "Phone",
|
15
|
-
:fax => "Fax",
|
16
|
-
:mobile => "Mobile"
|
17
|
-
),
|
18
|
-
Person.create!(
|
19
|
-
:first_name => "First Name",
|
20
|
-
:last_name => "Last Name",
|
21
|
-
:email => "Email",
|
22
|
-
:title => "Title",
|
23
|
-
:twitter => "Twitter",
|
24
|
-
:www => "Www",
|
25
|
-
:context => "MyText",
|
26
|
-
:phone => "Phone",
|
27
|
-
:fax => "Fax",
|
28
|
-
:mobile => "Mobile"
|
29
|
-
)
|
30
|
-
])
|
31
|
-
end
|
32
|
-
|
33
|
-
it "renders a list of people" do
|
34
|
-
render
|
35
|
-
assert_select "div#count", :text => "2 people".to_s
|
36
|
-
assert_select "div#name", :text => "Title First Name Last Name".to_s, :count => 2
|
37
|
-
assert_select "div#email", :text => "Email: Email".to_s, :count => 2
|
38
|
-
assert_select "div#phone", :text => "Phone: Phone".to_s, :count => 2
|
39
|
-
assert_select "div#mobile", :text => "Mobile: Mobile".to_s, :count => 2
|
40
|
-
assert_select "div#www", :text => "http://Www".to_s, :count => 2
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
module CustomerVault
|
4
|
-
RSpec.describe "customer_vault/people/new", :type => :view do
|
5
|
-
before(:each) do
|
6
|
-
assign(:person, Person.new(
|
7
|
-
:first_name => "MyString",
|
8
|
-
:last_name => "MyString",
|
9
|
-
:email => "MyString",
|
10
|
-
:title => "MyString",
|
11
|
-
:twitter => "MyString",
|
12
|
-
:www => "MyString",
|
13
|
-
:context => "MyText",
|
14
|
-
:phone => "MyString",
|
15
|
-
:fax => "MyString",
|
16
|
-
:mobile => "MyString"
|
17
|
-
))
|
18
|
-
end
|
19
|
-
|
20
|
-
it "renders new person form" do
|
21
|
-
render
|
22
|
-
|
23
|
-
assert_select "form[action=?][method=?]", customer_vault.people_path, "post" do
|
24
|
-
|
25
|
-
assert_select "input#person_first_name[name=?]", "person[first_name]"
|
26
|
-
|
27
|
-
assert_select "input#person_last_name[name=?]", "person[last_name]"
|
28
|
-
|
29
|
-
assert_select "input#person_email[name=?]", "person[email]"
|
30
|
-
|
31
|
-
assert_select "input#person_title[name=?]", "person[title]"
|
32
|
-
|
33
|
-
assert_select "input#person_twitter[name=?]", "person[twitter]"
|
34
|
-
|
35
|
-
assert_select "input#person_www[name=?]", "person[www]"
|
36
|
-
|
37
|
-
assert_select "textarea#person_context[name=?]", "person[context]"
|
38
|
-
|
39
|
-
assert_select "input#person_phone[name=?]", "person[phone]"
|
40
|
-
|
41
|
-
assert_select "input#person_fax[name=?]", "person[fax]"
|
42
|
-
|
43
|
-
assert_select "input#person_mobile[name=?]", "person[mobile]"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|