enju_biblio 0.1.0.pre36 → 0.1.0.pre37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/scaffold.css +56 -0
  3. data/app/controllers/manifestations_controller.rb +18 -22
  4. data/app/controllers/series_statements_controller.rb +6 -35
  5. data/app/models/enju_biblio/ability.rb +2 -4
  6. data/app/models/manifestation.rb +75 -92
  7. data/app/models/series_statement.rb +13 -18
  8. data/app/views/manifestations/_edit_detail.html.erb +10 -0
  9. data/app/views/manifestations/_form.html.erb +49 -34
  10. data/app/views/manifestations/_manifestation.html.erb +2 -12
  11. data/app/views/manifestations/_show_detail_librarian.html.erb +3 -33
  12. data/app/views/manifestations/_show_detail_user.html.erb +3 -18
  13. data/app/views/manifestations/_show_parent.html.erb +0 -12
  14. data/app/views/manifestations/_show_series_detail.html.erb +26 -0
  15. data/app/views/manifestations/show.html.erb +1 -27
  16. data/app/views/series_statements/_form.html.erb +1 -1
  17. data/app/views/series_statements/_index.html.erb +3 -11
  18. data/app/views/series_statements/show.html.erb +22 -30
  19. data/config/locales/translation_en.yml +2 -0
  20. data/config/locales/translation_ja.yml +2 -0
  21. data/config/routes.rb +3 -7
  22. data/db/migrate/005_create_manifestations.rb +4 -3
  23. data/db/migrate/20081028083142_create_patron_import_files.rb +1 -1
  24. data/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  25. data/lib/enju_biblio/biblio_helper.rb +1 -1
  26. data/lib/enju_biblio/version.rb +1 -1
  27. data/spec/controllers/import_requests_controller_spec.rb +1 -1
  28. data/spec/controllers/manifestations_controller_spec.rb +0 -6
  29. data/spec/controllers/series_statements_controller_spec.rb +4 -4
  30. data/spec/dummy/app/controllers/application_controller.rb +1 -0
  31. data/spec/dummy/app/models/ability.rb +2 -4
  32. data/spec/dummy/config/application.rb +1 -0
  33. data/spec/dummy/db/development.sqlite3 +0 -0
  34. data/spec/dummy/db/migrate/029_create_subjects.rb +27 -0
  35. data/spec/dummy/db/migrate/142_create_classifications.rb +19 -0
  36. data/spec/dummy/db/migrate/144_create_classification_types.rb +16 -0
  37. data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +16 -0
  38. data/spec/dummy/db/migrate/146_create_subject_types.rb +16 -0
  39. data/spec/dummy/db/migrate/20080606052544_create_work_has_subjects.rb +18 -0
  40. data/spec/dummy/db/migrate/20090208044541_create_subject_heading_type_has_subjects.rb +16 -0
  41. data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
  42. data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +5 -0
  43. data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
  44. data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
  45. data/spec/dummy/db/schema.rb +92 -9
  46. data/spec/dummy/db/test.sqlite3 +0 -0
  47. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  48. data/spec/dummy/solr/data/test/index/segments_l8s +0 -0
  49. data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
  50. data/spec/fixtures/manifestations.yml +66 -70
  51. data/spec/fixtures/series_statements.yml +1 -1
  52. data/spec/fixtures/subject_types.yml +28 -0
  53. data/spec/models/import_request_spec.rb +2 -0
  54. data/spec/models/manifestation_spec.rb +66 -70
  55. data/spec/models/series_statement_spec.rb +1 -0
  56. metadata +35 -37
  57. data/app/controllers/series_statement_relationships_controller.rb +0 -20
  58. data/app/models/series_statement_relationship.rb +0 -30
  59. data/app/views/series_statement_relationships/_form.html.erb +0 -27
  60. data/app/views/series_statement_relationships/edit.html.erb +0 -15
  61. data/app/views/series_statement_relationships/index.html.erb +0 -34
  62. data/app/views/series_statement_relationships/new.html.erb +0 -14
  63. data/app/views/series_statement_relationships/show.html.erb +0 -24
  64. data/app/views/series_statements/_index_parent.html.erb +0 -53
  65. data/app/views/series_statements/_manifestation_list.html.erb +0 -17
  66. data/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
  67. data/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
  68. data/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
  69. data/db/migrate/20120728204337_create_series_statement_relationships.rb +0 -11
  70. data/spec/controllers/series_statement_relationships_controller_spec.rb +0 -179
  71. data/spec/dummy/solr/data/test/index/segments_iwe +0 -0
  72. data/spec/models/series_statement_relationship_spec.rb +0 -17
  73. data/spec/requests/series_statement_relationships_spec.rb +0 -11
  74. data/spec/routing/series_statement_relationships_routing_spec.rb +0 -35
  75. data/spec/views/series_statement_relationships/edit.html.erb_spec.rb +0 -20
  76. data/spec/views/series_statement_relationships/index.html.erb_spec.rb +0 -23
  77. data/spec/views/series_statement_relationships/new.html.erb_spec.rb +0 -20
  78. data/spec/views/series_statement_relationships/show.html.erb_spec.rb +0 -17
@@ -1,179 +0,0 @@
1
- require 'spec_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
- describe SeriesStatementRelationshipsController do
22
- fixtures :all
23
-
24
- # This should return the minimal set of attributes required to create a valid
25
- # SeriesStatementRelationship. As you add validations to SeriesStatementRelationship, be sure to
26
- # update the return value of this method accordingly.
27
- def valid_attributes
28
- FactoryGirl.attributes_for(:series_statement_relationship)
29
- end
30
-
31
- # This should return the minimal set of values that should be in the session
32
- # in order to pass any filters (e.g. authentication) defined in
33
- # SeriesStatementRelationshipsController. Be sure to keep this updated too.
34
- def valid_session
35
- {}
36
- end
37
-
38
- describe "GET index" do
39
- login_fixture_librarian
40
-
41
- it "assigns all series_statement_relationships as @series_statement_relationships" do
42
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
43
- get :index
44
- assigns(:series_statement_relationships).should eq([series_statement_relationship])
45
- end
46
- end
47
-
48
- describe "GET show" do
49
- login_fixture_librarian
50
-
51
- it "assigns the requested series_statement_relationship as @series_statement_relationship" do
52
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
53
- get :show, {:id => series_statement_relationship.to_param}, valid_session
54
- assigns(:series_statement_relationship).should eq(series_statement_relationship)
55
- end
56
- end
57
-
58
- describe "GET new" do
59
- login_fixture_librarian
60
-
61
- it "assigns a new series_statement_relationship as @series_statement_relationship" do
62
- get :new
63
- assigns(:series_statement_relationship).should be_a_new(SeriesStatementRelationship)
64
- end
65
- end
66
-
67
- describe "GET edit" do
68
- login_fixture_librarian
69
-
70
- it "assigns the requested series_statement_relationship as @series_statement_relationship" do
71
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
72
- get :edit, {:id => series_statement_relationship.to_param}
73
- assigns(:series_statement_relationship).should eq(series_statement_relationship)
74
- end
75
- end
76
-
77
- describe "POST create" do
78
- login_fixture_librarian
79
-
80
- describe "with valid params" do
81
- it "creates a new SeriesStatementRelationship" do
82
- expect {
83
- post :create, {:series_statement_relationship => valid_attributes}
84
- }.to change(SeriesStatementRelationship, :count).by(1)
85
- end
86
-
87
- it "assigns a newly created series_statement_relationship as @series_statement_relationship" do
88
- post :create, {:series_statement_relationship => valid_attributes}
89
- assigns(:series_statement_relationship).should be_a(SeriesStatementRelationship)
90
- assigns(:series_statement_relationship).should be_persisted
91
- end
92
-
93
- it "redirects to the created series_statement_relationship" do
94
- post :create, {:series_statement_relationship => valid_attributes}
95
- response.should redirect_to(SeriesStatementRelationship.last)
96
- end
97
- end
98
-
99
- describe "with invalid params" do
100
- it "assigns a newly created but unsaved series_statement_relationship as @series_statement_relationship" do
101
- # Trigger the behavior that occurs when invalid params are submitted
102
- SeriesStatementRelationship.any_instance.stub(:save).and_return(false)
103
- post :create, {:series_statement_relationship => {}}
104
- assigns(:series_statement_relationship).should be_a_new(SeriesStatementRelationship)
105
- end
106
-
107
- it "re-renders the 'new' template" do
108
- # Trigger the behavior that occurs when invalid params are submitted
109
- #SeriesStatementRelationship.any_instance.stub(:save).and_return(false)
110
- post :create, {:series_statement_relationship => {}}
111
- response.should render_template("new")
112
- end
113
- end
114
- end
115
-
116
- describe "PUT update" do
117
- login_fixture_librarian
118
-
119
- describe "with valid params" do
120
- it "updates the requested series_statement_relationship" do
121
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
122
- # Assuming there are no other series_statement_relationships in the database, this
123
- # specifies that the SeriesStatementRelationship created on the previous line
124
- # receives the :update_attributes message with whatever params are
125
- # submitted in the request.
126
- SeriesStatementRelationship.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
127
- put :update, {:id => series_statement_relationship.to_param, :series_statement_relationship => {'these' => 'params'}}
128
- end
129
-
130
- it "assigns the requested series_statement_relationship as @series_statement_relationship" do
131
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
132
- put :update, {:id => series_statement_relationship.to_param, :series_statement_relationship => valid_attributes}
133
- assigns(:series_statement_relationship).should eq(series_statement_relationship)
134
- end
135
-
136
- it "redirects to the series_statement_relationship" do
137
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
138
- put :update, {:id => series_statement_relationship.to_param, :series_statement_relationship => valid_attributes}
139
- response.should redirect_to(series_statement_relationship)
140
- end
141
- end
142
-
143
- describe "with invalid params" do
144
- it "assigns the series_statement_relationship as @series_statement_relationship" do
145
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
146
- # Trigger the behavior that occurs when invalid params are submitted
147
- SeriesStatementRelationship.any_instance.stub(:save).and_return(false)
148
- put :update, {:id => series_statement_relationship.to_param, :series_statement_relationship => {}}
149
- assigns(:series_statement_relationship).should eq(series_statement_relationship)
150
- end
151
-
152
- it "re-renders the 'edit' template" do
153
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
154
- # Trigger the behavior that occurs when invalid params are submitted
155
- #SeriesStatementRelationship.any_instance.stub(:save).and_return(false)
156
- put :update, {:id => series_statement_relationship.to_param, :series_statement_relationship => {:parent_id => nil}}
157
- response.should render_template("edit")
158
- end
159
- end
160
- end
161
-
162
- describe "DELETE destroy" do
163
- login_fixture_librarian
164
-
165
- it "destroys the requested series_statement_relationship" do
166
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
167
- expect {
168
- delete :destroy, {:id => series_statement_relationship.to_param}
169
- }.to change(SeriesStatementRelationship, :count).by(-1)
170
- end
171
-
172
- it "redirects to the series_statement_relationships list" do
173
- series_statement_relationship = FactoryGirl.create(:series_statement_relationship)
174
- delete :destroy, {:id => series_statement_relationship.to_param}
175
- response.should redirect_to(series_statement_relationships_url)
176
- end
177
- end
178
-
179
- end
@@ -1,17 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe SeriesStatementRelationship do
4
- end
5
-
6
- # == Schema Information
7
- #
8
- # Table name: series_statement_relationships
9
- #
10
- # id :integer not null, primary key
11
- # parent_id :integer
12
- # child_id :integer
13
- # position :integer
14
- # created_at :datetime not null
15
- # updated_at :datetime not null
16
- #
17
-
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "SeriesStatementRelationships" do
4
- describe "GET /series_statement_relationships" do
5
- it "works! (now write some real specs)" do
6
- # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
7
- get series_statement_relationships_path
8
- response.status.should be(302)
9
- end
10
- end
11
- end
@@ -1,35 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe SeriesStatementRelationshipsController do
4
- describe "routing" do
5
-
6
- it "routes to #index" do
7
- get("/series_statement_relationships").should route_to("series_statement_relationships#index")
8
- end
9
-
10
- it "routes to #new" do
11
- get("/series_statement_relationships/new").should route_to("series_statement_relationships#new")
12
- end
13
-
14
- it "routes to #show" do
15
- get("/series_statement_relationships/1").should route_to("series_statement_relationships#show", :id => "1")
16
- end
17
-
18
- it "routes to #edit" do
19
- get("/series_statement_relationships/1/edit").should route_to("series_statement_relationships#edit", :id => "1")
20
- end
21
-
22
- it "routes to #create" do
23
- post("/series_statement_relationships").should route_to("series_statement_relationships#create")
24
- end
25
-
26
- it "routes to #update" do
27
- put("/series_statement_relationships/1").should route_to("series_statement_relationships#update", :id => "1")
28
- end
29
-
30
- it "routes to #destroy" do
31
- delete("/series_statement_relationships/1").should route_to("series_statement_relationships#destroy", :id => "1")
32
- end
33
-
34
- end
35
- end
@@ -1,20 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "series_statement_relationships/edit" do
4
- before(:each) do
5
- @series_statement_relationship = assign(:series_statement_relationship, stub_model(SeriesStatementRelationship,
6
- :parent_id => 1,
7
- :child_id => 1
8
- ))
9
- end
10
-
11
- it "renders the edit series_statement_relationship 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 => series_statement_relationships_path(@series_statement_relationship), :method => "post" do
16
- assert_select "input#series_statement_relationship_parent_id", :name => "series_statement_relationship[parent_id]"
17
- assert_select "input#series_statement_relationship_child_id", :name => "series_statement_relationship[child_id]"
18
- end
19
- end
20
- end
@@ -1,23 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "series_statement_relationships/index" do
4
- before(:each) do
5
- assign(:series_statement_relationships, Kaminari::paginate_array([
6
- stub_model(SeriesStatementRelationship,
7
- :parent_id => 1,
8
- :child_id => 2
9
- ),
10
- stub_model(SeriesStatementRelationship,
11
- :parent_id => 1,
12
- :child_id => 2
13
- )
14
- ]).page(1))
15
- end
16
-
17
- it "renders a list of series_statement_relationships" do
18
- render
19
- # Run the generator again with the --webrat flag if you want to use webrat matchers
20
- assert_select "tr>td", :text => "title1", :count => 2
21
- assert_select "tr>td", :text => "title2", :count => 2
22
- end
23
- end
@@ -1,20 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "series_statement_relationships/new" do
4
- before(:each) do
5
- assign(:series_statement_relationship, stub_model(SeriesStatementRelationship,
6
- :parent_id => 1,
7
- :child_id => 1
8
- ).as_new_record)
9
- end
10
-
11
- it "renders new series_statement_relationship 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 => series_statement_relationships_path, :method => "post" do
16
- assert_select "input#series_statement_relationship_parent_id", :name => "series_statement_relationship[parent_id]"
17
- assert_select "input#series_statement_relationship_child_id", :name => "series_statement_relationship[child_id]"
18
- end
19
- end
20
- end
@@ -1,17 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "series_statement_relationships/show" do
4
- before(:each) do
5
- @series_statement_relationship = assign(:series_statement_relationship, stub_model(SeriesStatementRelationship,
6
- :parent_id => 1,
7
- :child_id => 2
8
- ))
9
- end
10
-
11
- it "renders attributes in <p>" do
12
- render
13
- # Run the generator again with the --webrat flag if you want to use webrat matchers
14
- rendered.should match(/1/)
15
- rendered.should match(/2/)
16
- end
17
- end