enju_leaf 1.2.0.beta.1 → 1.2.0.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/enju_leaf/engine.rb +1 -15
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +3 -3
- data/lib/generators/enju_leaf/setup/setup_generator.rb +0 -1
- data/spec/controllers/page_controller_spec.rb +1 -1
- data/spec/dummy/app/controllers/application_controller.rb +0 -1
- data/spec/dummy/app/helpers/application_helper.rb +2 -1
- data/spec/dummy/app/models/user.rb +0 -1
- data/spec/dummy/config/application.rb +1 -2
- data/{db → spec/dummy/db}/migrate/041_create_roles.rb +0 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +1 -5
- data/spec/dummy/db/migrate/069_create_shelves.rb +1 -5
- data/{db → spec/dummy/db}/migrate/077_create_user_groups.rb +0 -0
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -5
- data/spec/dummy/db/migrate/131_create_request_types.rb +1 -5
- data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +9 -0
- data/{db → spec/dummy/db}/migrate/20100606065209_create_user_has_roles.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +0 -0
- data/spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb +6 -0
- data/{db → spec/dummy/db}/migrate/20130221154434_add_additional_attributes_to_user.rb +0 -0
- data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +6 -0
- data/{db → spec/dummy/db}/migrate/20140110122216_create_user_import_files.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140110131010_create_user_import_results.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140122054321_create_profiles.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140524074813_create_user_import_file_transitions.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140709113413_create_user_export_files.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140709113905_create_user_export_file_transitions.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20140811031145_add_expired_at_to_profile.rb +0 -0
- data/spec/dummy/db/migrate/20140821151023_create_colors.rb +14 -0
- data/{db → spec/dummy/db}/migrate/20141003181336_add_full_name_transcription_to_profile.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20141003182825_add_date_of_birth_to_profile.rb +0 -0
- data/spec/dummy/db/migrate/20141020120523_add_library_id_to_checkout.rb +6 -0
- data/spec/dummy/db/migrate/20150106001709_create_demands.rb +14 -0
- data/{db → spec/dummy/db}/migrate/20150421023923_create_identities.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20150506105356_add_error_message_to_user_import_result.rb +0 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/{db → spec/dummy/db}/migrate/20151126005552_add_provider_to_identity.rb +0 -0
- data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +5 -0
- data/{db → spec/dummy/db}/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +0 -0
- data/{db → spec/dummy/db}/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +0 -0
- data/spec/dummy/db/migrate/20160703184619_add_most_recent_to_reserve_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184650_add_most_recent_to_manifestation_checkout_stat_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184723_add_most_recent_to_manifestation_reserve_stat_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb +5 -0
- data/spec/dummy/db/schema.rb +47 -12
- data/spec/fixtures/library_groups.yml +1 -4
- data/spec/models/user_spec.rb +0 -22
- data/spec/rails_helper.rb +1 -1
- data/spec/views/page/index.html.erb_spec.rb +0 -2
- metadata +96 -337
- data/app/controllers/concerns/enju_leaf/controller.rb +0 -225
- data/app/controllers/my_accounts_controller.rb +0 -93
- data/app/controllers/names_controller.rb +0 -60
- data/app/controllers/profiles_controller.rb +0 -219
- data/app/controllers/roles_controller.rb +0 -61
- data/app/controllers/user_export_files_controller.rb +0 -116
- data/app/controllers/user_groups_controller.rb +0 -118
- data/app/controllers/user_import_files_controller.rb +0 -129
- data/app/controllers/user_import_results_controller.rb +0 -57
- data/app/mailers/notifier.rb +0 -30
- data/app/models/identity.rb +0 -9
- data/app/models/profile.rb +0 -101
- data/app/models/role.rb +0 -50
- data/app/models/user_export_file.rb +0 -67
- data/app/models/user_export_file_state_machine.rb +0 -15
- data/app/models/user_export_file_transition.rb +0 -20
- data/app/models/user_group.rb +0 -29
- data/app/models/user_has_role.rb +0 -19
- data/app/models/user_import_file.rb +0 -352
- data/app/models/user_import_file_state_machine.rb +0 -19
- data/app/models/user_import_file_transition.rb +0 -20
- data/app/models/user_import_result.rb +0 -20
- data/app/policies/application_policy.rb +0 -53
- data/app/policies/name_policy.rb +0 -21
- data/app/policies/profile_policy.rb +0 -55
- data/app/policies/role_policy.rb +0 -21
- data/app/policies/user_export_file_policy.rb +0 -21
- data/app/policies/user_group_policy.rb +0 -22
- data/app/policies/user_import_file_policy.rb +0 -21
- data/app/policies/user_import_result_policy.rb +0 -21
- data/app/views/my_accounts/_edit_credential.html.erb +0 -99
- data/app/views/my_accounts/_form.html.erb +0 -24
- data/app/views/my_accounts/_show.html.erb +0 -1
- data/app/views/my_accounts/edit.html.erb +0 -32
- data/app/views/my_accounts/show.html+phone.erb +0 -1
- data/app/views/my_accounts/show.html.erb +0 -49
- data/app/views/names/_form.html.erb +0 -41
- data/app/views/names/edit.html.erb +0 -6
- data/app/views/names/index.html.erb +0 -37
- data/app/views/names/new.html.erb +0 -5
- data/app/views/names/show.html.erb +0 -34
- data/app/views/profiles/_edit_credential.html.erb +0 -88
- data/app/views/profiles/_edit_profile.html.erb +0 -42
- data/app/views/profiles/_form.html.erb +0 -15
- data/app/views/profiles/_show.html.erb +0 -1
- data/app/views/profiles/edit.html.erb +0 -33
- data/app/views/profiles/index.html.erb +0 -70
- data/app/views/profiles/new.html.erb +0 -88
- data/app/views/profiles/show.html+phone.erb +0 -1
- data/app/views/profiles/show.html.erb +0 -71
- data/app/views/roles/_form.html.erb +0 -19
- data/app/views/roles/edit.html.erb +0 -13
- data/app/views/roles/index.html.erb +0 -32
- data/app/views/roles/new.html.erb +0 -12
- data/app/views/roles/show.html.erb +0 -46
- data/app/views/user_export_files/_form.html.erb +0 -12
- data/app/views/user_export_files/edit.html.erb +0 -6
- data/app/views/user_export_files/index.html.erb +0 -44
- data/app/views/user_export_files/new.html.erb +0 -16
- data/app/views/user_export_files/show.html.erb +0 -36
- data/app/views/user_groups/_form.html.erb +0 -40
- data/app/views/user_groups/edit.html.erb +0 -13
- data/app/views/user_groups/index.html.erb +0 -51
- data/app/views/user_groups/new.html.erb +0 -12
- data/app/views/user_groups/show.html.erb +0 -68
- data/app/views/user_import_files/_form.html.erb +0 -61
- data/app/views/user_import_files/_results.html.erb +0 -22
- data/app/views/user_import_files/edit.html.erb +0 -6
- data/app/views/user_import_files/index.html.erb +0 -45
- data/app/views/user_import_files/new.html.erb +0 -60
- data/app/views/user_import_files/show.html.erb +0 -85
- data/app/views/user_import_results/_form.html.erb +0 -29
- data/app/views/user_import_results/_list.html.erb +0 -22
- data/app/views/user_import_results/_list_lines.html.erb +0 -24
- data/app/views/user_import_results/index.html.erb +0 -25
- data/app/views/user_import_results/index.txt.erb +0 -3
- data/app/views/user_import_results/show.html.erb +0 -33
- data/db/migrate/20091202124834_create_versions.rb +0 -18
- data/spec/controllers/my_accounts_controller_spec.rb +0 -229
- data/spec/controllers/profiles_controller_spec.rb +0 -594
- data/spec/controllers/roles_controller_spec.rb +0 -136
- data/spec/controllers/user_export_files_controller_spec.rb +0 -296
- data/spec/controllers/user_groups_controller_spec.rb +0 -443
- data/spec/controllers/user_import_files_controller_spec.rb +0 -305
- data/spec/controllers/user_import_results_controller_spec.rb +0 -157
- data/spec/fixtures/user_export_files.yml +0 -25
- data/spec/fixtures/user_import_files.yml +0 -51
- data/spec/fixtures/user_import_results.yml +0 -26
- data/spec/fixtures/user_reserve_stats.yml +0 -27
- data/spec/models/basket_spec.rb +0 -23
- data/spec/models/profile_spec.rb +0 -98
- data/spec/models/role_spec.rb +0 -40
- data/spec/models/user_export_file_spec.rb +0 -30
- data/spec/models/user_group_spec.rb +0 -37
- data/spec/models/user_has_role_spec.rb +0 -18
- data/spec/models/user_import_file_spec.rb +0 -220
- data/spec/models/user_import_result_spec.rb +0 -20
- data/spec/requests/profiles_spec.rb +0 -9
- data/spec/routing/profiles_routing_spec.rb +0 -35
- data/spec/routing/resource_import_files_routing_spec.rb +0 -35
- data/spec/routing/roles_routing_spec.rb +0 -35
- data/spec/routing/users_spec.rb +0 -14
- data/spec/views/my_accounts/show.html.erb_spec.rb +0 -43
- data/spec/views/profiles/edit.html.erb_spec.rb +0 -42
- data/spec/views/profiles/index.html.erb_spec.rb +0 -19
- data/spec/views/profiles/new.html.erb_spec.rb +0 -25
- data/spec/views/profiles/show.html.erb_spec.rb +0 -31
- data/spec/views/user_export_files/new.html.erb_spec.rb +0 -19
- data/spec/views/user_import_results/index.html.erb_spec.rb +0 -29
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
require 'spec_helper'
|
|
3
|
-
|
|
4
|
-
describe UserImportResult do
|
|
5
|
-
#pending "add some examples to (or delete) #{__FILE__}"
|
|
6
|
-
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
# == Schema Information
|
|
10
|
-
#
|
|
11
|
-
# Table name: user_import_results
|
|
12
|
-
#
|
|
13
|
-
# id :integer not null, primary key
|
|
14
|
-
# user_import_file_id :integer
|
|
15
|
-
# user_id :integer
|
|
16
|
-
# body :text
|
|
17
|
-
# created_at :datetime
|
|
18
|
-
# updated_at :datetime
|
|
19
|
-
# error_message :text
|
|
20
|
-
#
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe ProfilesController do
|
|
4
|
-
describe "routing" do
|
|
5
|
-
|
|
6
|
-
it "recognizes and generates #index" do
|
|
7
|
-
{ get: "/profiles" }.should route_to(controller: "profiles", action: "index")
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it "recognizes and generates #new" do
|
|
11
|
-
{ get: "/profiles/new" }.should route_to(controller: "profiles", action: "new")
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it "recognizes and generates #show" do
|
|
15
|
-
{ get: "/profiles/1" }.should route_to(controller: "profiles", action: "show", id: "1")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it "recognizes and generates #edit" do
|
|
19
|
-
{ get: "/profiles/1/edit" }.should route_to(controller: "profiles", action: "edit", id: "1")
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "recognizes and generates #create" do
|
|
23
|
-
{ post: "/profiles" }.should route_to(controller: "profiles", action: "create")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "recognizes and generates #update" do
|
|
27
|
-
{ put: "/profiles/1" }.should route_to(controller: "profiles", action: "update", id: "1")
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it "recognizes and generates #destroy" do
|
|
31
|
-
{ delete: "/profiles/1" }.should route_to(controller: "profiles", action: "destroy", id: "1")
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe UserImportFilesController do
|
|
4
|
-
describe "routing" do
|
|
5
|
-
|
|
6
|
-
it "routes to #index" do
|
|
7
|
-
get("/user_import_files").should route_to("user_import_files#index")
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it "routes to #new" do
|
|
11
|
-
get("/user_import_files/new").should route_to("user_import_files#new")
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it "routes to #show" do
|
|
15
|
-
get("/user_import_files/1").should route_to("user_import_files#show", id: "1")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it "routes to #edit" do
|
|
19
|
-
get("/user_import_files/1/edit").should route_to("user_import_files#edit", id: "1")
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "routes to #create" do
|
|
23
|
-
post("/user_import_files").should route_to("user_import_files#create")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "routes to #update" do
|
|
27
|
-
put("/user_import_files/1").should route_to("user_import_files#update", id: "1")
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it "routes to #destroy" do
|
|
31
|
-
delete("/user_import_files/1").should route_to("user_import_files#destroy", id: "1")
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe RolesController do
|
|
4
|
-
describe "routing" do
|
|
5
|
-
|
|
6
|
-
it "recognizes and generates #index" do
|
|
7
|
-
{ :get => "/roles" }.should route_to(:controller => "roles", :action => "index")
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
#it "recognizes and generates #new" do
|
|
11
|
-
# { :get => "/roles/new" }.should route_to(:controller => "roles", :action => "new")
|
|
12
|
-
#end
|
|
13
|
-
|
|
14
|
-
it "recognizes and generates #show" do
|
|
15
|
-
{ :get => "/roles/1" }.should route_to(:controller => "roles", :action => "show", :id => "1")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it "recognizes and generates #edit" do
|
|
19
|
-
{ :get => "/roles/1/edit" }.should route_to(:controller => "roles", :action => "edit", :id => "1")
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
#it "recognizes and generates #create" do
|
|
23
|
-
# { :post => "/roles" }.should route_to(:controller => "roles", :action => "create")
|
|
24
|
-
#end
|
|
25
|
-
|
|
26
|
-
it "recognizes and generates #update" do
|
|
27
|
-
{ :put => "/roles/1" }.should route_to(:controller => "roles", :action => "update", :id => "1")
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
#it "recognizes and generates #destroy" do
|
|
31
|
-
# { :delete => "/roles/1" }.should route_to(:controller => "roles", :action => "destroy", :id => "1")
|
|
32
|
-
#end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
end
|
data/spec/routing/users_spec.rb
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe ProfilesController do
|
|
4
|
-
describe "routing" do
|
|
5
|
-
|
|
6
|
-
it "recognizes and generates #new" do
|
|
7
|
-
{ get: "/users/sign_in" }.should route_to(controller: "devise/sessions", action: "new")
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it "recognizes and generates #destroy" do
|
|
11
|
-
{ delete: "/users/sign_out" }.should route_to(controller: "devise/sessions", action: "destroy")
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe "my_accounts/show" do
|
|
4
|
-
fixtures :all
|
|
5
|
-
|
|
6
|
-
before(:each) do
|
|
7
|
-
@profile = assign(:profile, profiles(:admin))
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
describe "when logged in as Librarian" do
|
|
11
|
-
before(:each) do
|
|
12
|
-
@profile = assign(:profile, profiles(:librarian2))
|
|
13
|
-
user = users(:librarian1)
|
|
14
|
-
view.stub(:current_user).and_return(user)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it "renders attributes in <p>" do
|
|
18
|
-
allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
|
|
19
|
-
render
|
|
20
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
21
|
-
rendered.should match(/Checkout/)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it "cannot be deletable by other librarian" do
|
|
25
|
-
allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
|
|
26
|
-
render
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
describe "when logged in as User" do
|
|
31
|
-
before(:each) do
|
|
32
|
-
@profile = assign(:profile, profiles(:user2))
|
|
33
|
-
user = users(:librarian1)
|
|
34
|
-
view.stub(:current_user).and_return(user)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it "renders attributes in <p>" do
|
|
38
|
-
allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
|
|
39
|
-
render
|
|
40
|
-
rendered.should match(/Checkout/)
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe "profiles/edit" do
|
|
4
|
-
fixtures :all
|
|
5
|
-
|
|
6
|
-
before(:each) do
|
|
7
|
-
@profile = assign(:profile, profiles(:admin))
|
|
8
|
-
assign(:user_groups, UserGroup.all)
|
|
9
|
-
assign(:libraries, Library.all)
|
|
10
|
-
assign(:roles, Role.all)
|
|
11
|
-
assign(:available_languages, Language.available_languages)
|
|
12
|
-
view.stub(:current_user).and_return(User.friendly.find('enjuadmin'))
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
describe "when logged in as librarian" do
|
|
16
|
-
before(:each) do
|
|
17
|
-
@profile = assign(:profile, profiles(:librarian2))
|
|
18
|
-
user = users(:librarian1)
|
|
19
|
-
view.stub(:current_user).and_return(user)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "renders the edit user form" do
|
|
23
|
-
allow(view).to receive(:policy).and_return double(destroy?: true)
|
|
24
|
-
render
|
|
25
|
-
assert_select "form", action: profiles_path(@profile), method: "post" do
|
|
26
|
-
assert_select "input#profile_user_number", name: "profile[user_number]"
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it "should not display 'delete' link" do
|
|
31
|
-
allow(view).to receive(:policy).and_return double(destroy?: false)
|
|
32
|
-
render
|
|
33
|
-
expect(rendered).not_to have_selector("a[href='#{profile_path(@profile.id)}'][data-method='delete']")
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it "should disable role selection" do
|
|
37
|
-
allow(view).to receive(:policy).and_return double(destroy?: true)
|
|
38
|
-
render
|
|
39
|
-
expect(rendered).to have_selector("select#profile_user_attributes_user_has_role_attributes_role_id[disabled='disabled']")
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe "profiles/index" do
|
|
4
|
-
fixtures :all
|
|
5
|
-
|
|
6
|
-
before(:each) do
|
|
7
|
-
assign(:profiles, Profile.page(1))
|
|
8
|
-
admin = User.friendly.find('enjuadmin')
|
|
9
|
-
view.stub(:current_user).and_return(admin)
|
|
10
|
-
view.stub(:params).and_return(ActionController::Parameters.new)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it "renders a list of profiles" do
|
|
14
|
-
allow(view).to receive(:policy).and_return double(create?: true, update?: true, destroy?: true)
|
|
15
|
-
render
|
|
16
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
17
|
-
assert_select "tr>td", :text => 'enjuadmin'
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe "profiles/new" do
|
|
4
|
-
fixtures :user_groups
|
|
5
|
-
|
|
6
|
-
before(:each) do
|
|
7
|
-
assign(:profile, stub_model(Profile,
|
|
8
|
-
:user_group_id => 1
|
|
9
|
-
).as_new_record)
|
|
10
|
-
assign(:user_groups, UserGroup.all)
|
|
11
|
-
assign(:libraries, Library.all)
|
|
12
|
-
assign(:roles, Role.all)
|
|
13
|
-
assign(:available_languages, Language.available_languages)
|
|
14
|
-
view.stub(:current_user).and_return(User.find('enjuadmin'))
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it "renders new user form" do
|
|
18
|
-
render
|
|
19
|
-
|
|
20
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
21
|
-
assert_select "form", action: profiles_path, method: "post" do
|
|
22
|
-
assert_select "input#profile_user_number", name: "profile[user_number]"
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
require 'spec_helper'
|
|
3
|
-
|
|
4
|
-
describe "profiles/show" do
|
|
5
|
-
fixtures :all
|
|
6
|
-
|
|
7
|
-
before(:each) do
|
|
8
|
-
@profile = assign(:profile, profiles(:admin))
|
|
9
|
-
view.stub(:current_user).and_return(User.friendly.find('enjuadmin'))
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it "renders attributes in <p>" do
|
|
13
|
-
allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
|
|
14
|
-
render
|
|
15
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
16
|
-
rendered.should match(/Checkout/)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
describe "when logged in as Librarian" do
|
|
20
|
-
before(:each) do
|
|
21
|
-
@profile = assign(:profile, profiles(:librarian2))
|
|
22
|
-
user = users(:librarian1)
|
|
23
|
-
view.stub(:current_user).and_return(user)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "cannot be deletable by other librarian" do
|
|
27
|
-
allow(view).to receive(:policy).and_return double(update?: true, destroy?: true)
|
|
28
|
-
render
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe "user_export_files/new" do
|
|
4
|
-
before(:each) do
|
|
5
|
-
assign(:user_export_file, stub_model(
|
|
6
|
-
UserExportFile
|
|
7
|
-
).as_new_record)
|
|
8
|
-
view.stub(:current_user).and_return(User.find('enjuadmin'))
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it "renders new user form" do
|
|
12
|
-
render
|
|
13
|
-
|
|
14
|
-
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
15
|
-
assert_select "form", action: user_export_files_path, method: "post" do
|
|
16
|
-
assert_select "input", name: "commit"
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require 'rails_helper'
|
|
2
|
-
|
|
3
|
-
describe "user_import_results/index" do
|
|
4
|
-
fixtures :all
|
|
5
|
-
|
|
6
|
-
before(:each) do
|
|
7
|
-
assign(:user_import_results, UserImportResult.page(1))
|
|
8
|
-
admin = User.find('enjuadmin')
|
|
9
|
-
view.stub(:current_user).and_return(admin)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it "renders a list of user_import_results" do
|
|
13
|
-
render
|
|
14
|
-
expect(rendered).to match /MyString/
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
context "with @user_import_file" do
|
|
18
|
-
before(:each) do
|
|
19
|
-
@user_import_file = UserImportFile.find(1)
|
|
20
|
-
@user_import_results = UserImportResult.where(user_import_file_id: 1).page(1)
|
|
21
|
-
end
|
|
22
|
-
it "renders a list of user_import_results for the user_import_file" do
|
|
23
|
-
render
|
|
24
|
-
expect(view).to render_template "user_import_results/_list_lines"
|
|
25
|
-
expect(rendered).to match /MyString/
|
|
26
|
-
expect(rendered).to match /<td>1<\/td>/
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|