paper_trail_manager 0.6.0 → 0.8.0

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.
Files changed (144) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +54 -0
  3. data/.gitignore +3 -2
  4. data/.rubocop.yml +33 -0
  5. data/.ruby-version +1 -0
  6. data/Appraisals +15 -12
  7. data/CHANGES.md +24 -0
  8. data/Gemfile +2 -1
  9. data/README.md +130 -66
  10. data/Rakefile +19 -5
  11. data/app/controllers/paper_trail_manager/changes_controller.rb +119 -101
  12. data/app/helpers/paper_trail_manager/changes_helper.rb +17 -13
  13. data/app/views/paper_trail_manager/changes/_version.html.erb +1 -1
  14. data/app/views/paper_trail_manager/changes/index.atom.builder +23 -19
  15. data/app/views/paper_trail_manager/changes/index.html.erb +41 -28
  16. data/app/views/paper_trail_manager/changes/show.html.erb +9 -6
  17. data/gemfiles/rails_6.1_paper_trail_12.0_kaminari.gemfile +10 -0
  18. data/gemfiles/rails_6.1_paper_trail_12.0_will_paginate.gemfile +10 -0
  19. data/gemfiles/rails_7.0_paper_trail_12.0_kaminari.gemfile +10 -0
  20. data/gemfiles/rails_7.0_paper_trail_12.0_will_paginate.gemfile +10 -0
  21. data/gemfiles/rails_7.0_paper_trail_15.0_kaminari.gemfile +10 -0
  22. data/gemfiles/rails_7.0_paper_trail_15.0_will_paginate.gemfile +10 -0
  23. data/gemfiles/rails_7.1_paper_trail_15.0_kaminari.gemfile +10 -0
  24. data/gemfiles/rails_7.1_paper_trail_15.0_will_paginate.gemfile +10 -0
  25. data/lib/paper_trail_manager.rb +11 -9
  26. data/paper_trail_manager.gemspec +25 -24
  27. data/spec/app_template.rb +39 -0
  28. data/spec/integration/authorization_spec.rb +84 -0
  29. data/spec/integration/date_filter_spec.rb +84 -0
  30. data/spec/integration/navigation_spec.rb +5 -3
  31. data/spec/integration/paper_trail_manager_spec.rb +94 -110
  32. data/spec/integration/response_formats_spec.rb +73 -0
  33. data/spec/rails_helper.rb +6 -4
  34. data/spec/spec_helper.rb +7 -5
  35. data/spec/support/factories.rb +4 -3
  36. data/spec/support/rspec_html_matchers.rb +7 -0
  37. data/spec/unit/authorization_spec.rb +42 -0
  38. data/spec/unit/changes_helper_spec.rb +81 -0
  39. metadata +103 -238
  40. data/.travis.yml +0 -23
  41. data/gemfiles/rails_3.2.0_paper_trail_3.0_kaminari.gemfile +0 -10
  42. data/gemfiles/rails_3.2.0_paper_trail_3.0_will_paginate.gemfile +0 -10
  43. data/gemfiles/rails_3.2.0_paper_trail_4.0_kaminari.gemfile +0 -10
  44. data/gemfiles/rails_3.2.0_paper_trail_4.0_will_paginate.gemfile +0 -10
  45. data/gemfiles/rails_4.0.0_paper_trail_3.0_kaminari.gemfile +0 -9
  46. data/gemfiles/rails_4.0.0_paper_trail_3.0_will_paginate.gemfile +0 -9
  47. data/gemfiles/rails_4.0.0_paper_trail_4.0_kaminari.gemfile +0 -9
  48. data/gemfiles/rails_4.0.0_paper_trail_4.0_will_paginate.gemfile +0 -9
  49. data/gemfiles/rails_4.1.0_paper_trail_3.0_kaminari.gemfile +0 -9
  50. data/gemfiles/rails_4.1.0_paper_trail_3.0_will_paginate.gemfile +0 -9
  51. data/gemfiles/rails_4.1.0_paper_trail_4.0_kaminari.gemfile +0 -9
  52. data/gemfiles/rails_4.1.0_paper_trail_4.0_will_paginate.gemfile +0 -9
  53. data/gemfiles/rails_4.2.2_paper_trail_3.0_kaminari.gemfile +0 -9
  54. data/gemfiles/rails_4.2.2_paper_trail_3.0_will_paginate.gemfile +0 -9
  55. data/gemfiles/rails_4.2.2_paper_trail_4.0_kaminari.gemfile +0 -9
  56. data/gemfiles/rails_4.2.2_paper_trail_4.0_will_paginate.gemfile +0 -9
  57. data/spec/controllers/entities_controller_spec.rb +0 -125
  58. data/spec/controllers/platforms_controller_spec.rb +0 -125
  59. data/spec/dummy/.gitignore +0 -15
  60. data/spec/dummy/Gemfile +0 -9
  61. data/spec/dummy/README.rdoc +0 -261
  62. data/spec/dummy/Rakefile +0 -7
  63. data/spec/dummy/app/assets/images/rails.png +0 -0
  64. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  65. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  66. data/spec/dummy/app/controllers/application_controller.rb +0 -6
  67. data/spec/dummy/app/controllers/entities_controller.rb +0 -83
  68. data/spec/dummy/app/controllers/platforms_controller.rb +0 -83
  69. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  70. data/spec/dummy/app/helpers/entities_helper.rb +0 -2
  71. data/spec/dummy/app/helpers/platforms_helper.rb +0 -2
  72. data/spec/dummy/app/mailers/.gitkeep +0 -0
  73. data/spec/dummy/app/models/.gitkeep +0 -0
  74. data/spec/dummy/app/models/entity.rb +0 -6
  75. data/spec/dummy/app/models/platform.rb +0 -6
  76. data/spec/dummy/app/views/application/index.html.erb +0 -6
  77. data/spec/dummy/app/views/entities/_form.html.erb +0 -17
  78. data/spec/dummy/app/views/entities/edit.html.erb +0 -6
  79. data/spec/dummy/app/views/entities/index.html.erb +0 -21
  80. data/spec/dummy/app/views/entities/new.html.erb +0 -5
  81. data/spec/dummy/app/views/entities/show.html.erb +0 -5
  82. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  83. data/spec/dummy/app/views/platforms/_form.html.erb +0 -17
  84. data/spec/dummy/app/views/platforms/edit.html.erb +0 -6
  85. data/spec/dummy/app/views/platforms/index.html.erb +0 -21
  86. data/spec/dummy/app/views/platforms/new.html.erb +0 -5
  87. data/spec/dummy/app/views/platforms/show.html.erb +0 -5
  88. data/spec/dummy/config/application.rb +0 -64
  89. data/spec/dummy/config/boot.rb +0 -6
  90. data/spec/dummy/config/database.yml +0 -22
  91. data/spec/dummy/config/environment.rb +0 -5
  92. data/spec/dummy/config/environments/development.rb +0 -37
  93. data/spec/dummy/config/environments/production.rb +0 -67
  94. data/spec/dummy/config/environments/test.rb +0 -36
  95. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  96. data/spec/dummy/config/initializers/inflections.rb +0 -15
  97. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  98. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  99. data/spec/dummy/config/initializers/session_store.rb +0 -8
  100. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  101. data/spec/dummy/config/locales/en.yml +0 -5
  102. data/spec/dummy/config/routes.rb +0 -8
  103. data/spec/dummy/config.ru +0 -4
  104. data/spec/dummy/db/migrate/20110228091428_create_entities.rb +0 -14
  105. data/spec/dummy/db/migrate/20110228093241_create_platforms.rb +0 -14
  106. data/spec/dummy/db/migrate/20110228094444_create_versions.rb +0 -18
  107. data/spec/dummy/db/schema.rb +0 -41
  108. data/spec/dummy/db/seeds.rb +0 -7
  109. data/spec/dummy/doc/README_FOR_APP +0 -2
  110. data/spec/dummy/lib/assets/.gitkeep +0 -0
  111. data/spec/dummy/lib/tasks/.gitkeep +0 -0
  112. data/spec/dummy/log/.gitkeep +0 -0
  113. data/spec/dummy/public/404.html +0 -26
  114. data/spec/dummy/public/422.html +0 -26
  115. data/spec/dummy/public/500.html +0 -25
  116. data/spec/dummy/public/favicon.ico +0 -0
  117. data/spec/dummy/public/index.html +0 -241
  118. data/spec/dummy/public/robots.txt +0 -5
  119. data/spec/dummy/script/rails +0 -6
  120. data/spec/dummy/test/fixtures/.gitkeep +0 -0
  121. data/spec/dummy/test/functional/.gitkeep +0 -0
  122. data/spec/dummy/test/integration/.gitkeep +0 -0
  123. data/spec/dummy/test/performance/browsing_test.rb +0 -12
  124. data/spec/dummy/test/test_helper.rb +0 -13
  125. data/spec/dummy/test/unit/.gitkeep +0 -0
  126. data/spec/dummy/vendor/assets/javascripts/.gitkeep +0 -0
  127. data/spec/dummy/vendor/assets/stylesheets/.gitkeep +0 -0
  128. data/spec/dummy/vendor/plugins/.gitkeep +0 -0
  129. data/spec/helpers/entities_helper_spec.rb +0 -15
  130. data/spec/helpers/platforms_helper_spec.rb +0 -15
  131. data/spec/models/entity_spec.rb +0 -14
  132. data/spec/models/platform_spec.rb +0 -14
  133. data/spec/requests/entities_spec.rb +0 -11
  134. data/spec/requests/platforms_spec.rb +0 -11
  135. data/spec/routing/entities_routing_spec.rb +0 -35
  136. data/spec/routing/platforms_routing_spec.rb +0 -35
  137. data/spec/views/entities/edit.html.erb_spec.rb +0 -15
  138. data/spec/views/entities/index.html.erb_spec.rb +0 -14
  139. data/spec/views/entities/new.html.erb_spec.rb +0 -15
  140. data/spec/views/entities/show.html.erb_spec.rb +0 -11
  141. data/spec/views/platforms/edit.html.erb_spec.rb +0 -15
  142. data/spec/views/platforms/index.html.erb_spec.rb +0 -14
  143. data/spec/views/platforms/new.html.erb_spec.rb +0 -15
  144. data/spec/views/platforms/show.html.erb_spec.rb +0 -11
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.0
5
- - 2.1
6
- gemfile:
7
- - gemfiles/rails_3.2.0_paper_trail_3.0_kaminari.gemfile
8
- - gemfiles/rails_3.2.0_paper_trail_3.0_will_paginate.gemfile
9
- - gemfiles/rails_3.2.0_paper_trail_4.0_kaminari.gemfile
10
- - gemfiles/rails_3.2.0_paper_trail_4.0_will_paginate.gemfile
11
- - gemfiles/rails_4.0.0_paper_trail_3.0_kaminari.gemfile
12
- - gemfiles/rails_4.0.0_paper_trail_3.0_will_paginate.gemfile
13
- - gemfiles/rails_4.0.0_paper_trail_4.0_kaminari.gemfile
14
- - gemfiles/rails_4.0.0_paper_trail_4.0_will_paginate.gemfile
15
- - gemfiles/rails_4.1.0_paper_trail_3.0_kaminari.gemfile
16
- - gemfiles/rails_4.1.0_paper_trail_3.0_will_paginate.gemfile
17
- - gemfiles/rails_4.1.0_paper_trail_4.0_kaminari.gemfile
18
- - gemfiles/rails_4.1.0_paper_trail_4.0_will_paginate.gemfile
19
- - gemfiles/rails_4.2.2_paper_trail_3.0_kaminari.gemfile
20
- - gemfiles/rails_4.2.2_paper_trail_3.0_will_paginate.gemfile
21
- - gemfiles/rails_4.2.2_paper_trail_4.0_kaminari.gemfile
22
- - gemfiles/rails_4.2.2_paper_trail_4.0_will_paginate.gemfile
23
- cache: bundler
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 3.2.0"
6
- gem "paper_trail", "~> 3.0"
7
- gem "kaminari", "~> 0.16"
8
- gem "test-unit", "~> 3.0"
9
-
10
- gemspec :path => "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 3.2.0"
6
- gem "paper_trail", "~> 3.0"
7
- gem "will_paginate", "~> 3.0"
8
- gem "test-unit", "~> 3.0"
9
-
10
- gemspec :path => "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 3.2.0"
6
- gem "paper_trail", "~> 4.0"
7
- gem "kaminari", "~> 0.16"
8
- gem "test-unit", "~> 3.0"
9
-
10
- gemspec :path => "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 3.2.0"
6
- gem "paper_trail", "~> 4.0"
7
- gem "will_paginate", "~> 3.0"
8
- gem "test-unit", "~> 3.0"
9
-
10
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.0"
6
- gem "paper_trail", "~> 3.0"
7
- gem "kaminari", "~> 0.16"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.0"
6
- gem "paper_trail", "~> 3.0"
7
- gem "will_paginate", "~> 3.0"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.0"
6
- gem "paper_trail", "~> 4.0"
7
- gem "kaminari", "~> 0.16"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.0"
6
- gem "paper_trail", "~> 4.0"
7
- gem "will_paginate", "~> 3.0"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.1.0"
6
- gem "paper_trail", "~> 3.0"
7
- gem "kaminari", "~> 0.16"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.1.0"
6
- gem "paper_trail", "~> 3.0"
7
- gem "will_paginate", "~> 3.0"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.1.0"
6
- gem "paper_trail", "~> 4.0"
7
- gem "kaminari", "~> 0.16"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.1.0"
6
- gem "paper_trail", "~> 4.0"
7
- gem "will_paginate", "~> 3.0"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.2.2"
6
- gem "paper_trail", "~> 3.0"
7
- gem "kaminari", "~> 0.16"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.2.2"
6
- gem "paper_trail", "~> 3.0"
7
- gem "will_paginate", "~> 3.0"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.2.2"
6
- gem "paper_trail", "~> 4.0"
7
- gem "kaminari", "~> 0.16"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.2.2"
6
- gem "paper_trail", "~> 4.0"
7
- gem "will_paginate", "~> 3.0"
8
-
9
- gemspec :path => "../"
@@ -1,125 +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 the Rails when you ran the scaffold generator.
6
-
7
- describe EntitiesController do
8
-
9
- def mock_entity(stubs={})
10
- @mock_entity ||= mock_model(Entity, stubs)
11
- end
12
-
13
- describe "GET index" do
14
- it "assigns all entities as @entities" do
15
- Entity.stub(:all) { [mock_entity] }
16
- get :index
17
- assigns(:entities).should eq([mock_entity])
18
- end
19
- end
20
-
21
- describe "GET show" do
22
- it "assigns the requested entity as @entity" do
23
- Entity.stub(:find).with("37") { mock_entity }
24
- get :show, :id => "37"
25
- assigns(:entity).should be(mock_entity)
26
- end
27
- end
28
-
29
- describe "GET new" do
30
- it "assigns a new entity as @entity" do
31
- Entity.stub(:new) { mock_entity }
32
- get :new
33
- assigns(:entity).should be(mock_entity)
34
- end
35
- end
36
-
37
- describe "GET edit" do
38
- it "assigns the requested entity as @entity" do
39
- Entity.stub(:find).with("37") { mock_entity }
40
- get :edit, :id => "37"
41
- assigns(:entity).should be(mock_entity)
42
- end
43
- end
44
-
45
- describe "POST create" do
46
- describe "with valid params" do
47
- it "assigns a newly created entity as @entity" do
48
- Entity.stub(:new).with({'these' => 'params'}) { mock_entity(:save => true) }
49
- post :create, :entity => {'these' => 'params'}
50
- assigns(:entity).should be(mock_entity)
51
- end
52
-
53
- it "redirects to the created entity" do
54
- Entity.stub(:new) { mock_entity(:save => true) }
55
- post :create, :entity => {}
56
- response.should redirect_to(entity_url(mock_entity))
57
- end
58
- end
59
-
60
- describe "with invalid params" do
61
- it "assigns a newly created but unsaved entity as @entity" do
62
- Entity.stub(:new).with({'these' => 'params'}) { mock_entity(:save => false) }
63
- post :create, :entity => {'these' => 'params'}
64
- assigns(:entity).should be(mock_entity)
65
- end
66
-
67
- it "re-renders the 'new' template" do
68
- Entity.stub(:new) { mock_entity(:save => false) }
69
- post :create, :entity => {}
70
- response.should render_template("new")
71
- end
72
- end
73
- end
74
-
75
- describe "PUT update" do
76
- describe "with valid params" do
77
- it "updates the requested entity" do
78
- Entity.stub(:find).with("37") { mock_entity }
79
- mock_entity.should_receive(:update_attributes).with({'these' => 'params'})
80
- put :update, :id => "37", :entity => {'these' => 'params'}
81
- end
82
-
83
- it "assigns the requested entity as @entity" do
84
- Entity.stub(:find) { mock_entity(:update_attributes => true) }
85
- put :update, :id => "1"
86
- assigns(:entity).should be(mock_entity)
87
- end
88
-
89
- it "redirects to the entity" do
90
- Entity.stub(:find) { mock_entity(:update_attributes => true) }
91
- put :update, :id => "1"
92
- response.should redirect_to(entity_url(mock_entity))
93
- end
94
- end
95
-
96
- describe "with invalid params" do
97
- it "assigns the entity as @entity" do
98
- Entity.stub(:find) { mock_entity(:update_attributes => false) }
99
- put :update, :id => "1"
100
- assigns(:entity).should be(mock_entity)
101
- end
102
-
103
- it "re-renders the 'edit' template" do
104
- Entity.stub(:find) { mock_entity(:update_attributes => false) }
105
- put :update, :id => "1"
106
- response.should render_template("edit")
107
- end
108
- end
109
- end
110
-
111
- describe "DELETE destroy" do
112
- it "destroys the requested entity" do
113
- Entity.stub(:find).with("37") { mock_entity }
114
- mock_entity.should_receive(:destroy)
115
- delete :destroy, :id => "37"
116
- end
117
-
118
- it "redirects to the entities list" do
119
- Entity.stub(:find) { mock_entity }
120
- delete :destroy, :id => "1"
121
- response.should redirect_to(entities_url)
122
- end
123
- end
124
-
125
- end
@@ -1,125 +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 the Rails when you ran the scaffold generator.
6
-
7
- describe PlatformsController do
8
-
9
- def mock_platform(stubs={})
10
- @mock_platform ||= mock_model(Platform, stubs)
11
- end
12
-
13
- describe "GET index" do
14
- it "assigns all platforms as @platforms" do
15
- Platform.stub(:all) { [mock_platform] }
16
- get :index
17
- assigns(:platforms).should eq([mock_platform])
18
- end
19
- end
20
-
21
- describe "GET show" do
22
- it "assigns the requested platform as @platform" do
23
- Platform.stub(:find).with("37") { mock_platform }
24
- get :show, :id => "37"
25
- assigns(:platform).should be(mock_platform)
26
- end
27
- end
28
-
29
- describe "GET new" do
30
- it "assigns a new platform as @platform" do
31
- Platform.stub(:new) { mock_platform }
32
- get :new
33
- assigns(:platform).should be(mock_platform)
34
- end
35
- end
36
-
37
- describe "GET edit" do
38
- it "assigns the requested platform as @platform" do
39
- Platform.stub(:find).with("37") { mock_platform }
40
- get :edit, :id => "37"
41
- assigns(:platform).should be(mock_platform)
42
- end
43
- end
44
-
45
- describe "POST create" do
46
- describe "with valid params" do
47
- it "assigns a newly created platform as @platform" do
48
- Platform.stub(:new).with({'these' => 'params'}) { mock_platform(:save => true) }
49
- post :create, :platform => {'these' => 'params'}
50
- assigns(:platform).should be(mock_platform)
51
- end
52
-
53
- it "redirects to the created platform" do
54
- Platform.stub(:new) { mock_platform(:save => true) }
55
- post :create, :platform => {}
56
- response.should redirect_to(platform_url(mock_platform))
57
- end
58
- end
59
-
60
- describe "with invalid params" do
61
- it "assigns a newly created but unsaved platform as @platform" do
62
- Platform.stub(:new).with({'these' => 'params'}) { mock_platform(:save => false) }
63
- post :create, :platform => {'these' => 'params'}
64
- assigns(:platform).should be(mock_platform)
65
- end
66
-
67
- it "re-renders the 'new' template" do
68
- Platform.stub(:new) { mock_platform(:save => false) }
69
- post :create, :platform => {}
70
- response.should render_template("new")
71
- end
72
- end
73
- end
74
-
75
- describe "PUT update" do
76
- describe "with valid params" do
77
- it "updates the requested platform" do
78
- Platform.stub(:find).with("37") { mock_platform }
79
- mock_platform.should_receive(:update_attributes).with({'these' => 'params'})
80
- put :update, :id => "37", :platform => {'these' => 'params'}
81
- end
82
-
83
- it "assigns the requested platform as @platform" do
84
- Platform.stub(:find) { mock_platform(:update_attributes => true) }
85
- put :update, :id => "1"
86
- assigns(:platform).should be(mock_platform)
87
- end
88
-
89
- it "redirects to the platform" do
90
- Platform.stub(:find) { mock_platform(:update_attributes => true) }
91
- put :update, :id => "1"
92
- response.should redirect_to(platform_url(mock_platform))
93
- end
94
- end
95
-
96
- describe "with invalid params" do
97
- it "assigns the platform as @platform" do
98
- Platform.stub(:find) { mock_platform(:update_attributes => false) }
99
- put :update, :id => "1"
100
- assigns(:platform).should be(mock_platform)
101
- end
102
-
103
- it "re-renders the 'edit' template" do
104
- Platform.stub(:find) { mock_platform(:update_attributes => false) }
105
- put :update, :id => "1"
106
- response.should render_template("edit")
107
- end
108
- end
109
- end
110
-
111
- describe "DELETE destroy" do
112
- it "destroys the requested platform" do
113
- Platform.stub(:find).with("37") { mock_platform }
114
- mock_platform.should_receive(:destroy)
115
- delete :destroy, :id => "37"
116
- end
117
-
118
- it "redirects to the platforms list" do
119
- Platform.stub(:find) { mock_platform }
120
- delete :destroy, :id => "1"
121
- response.should redirect_to(platforms_url)
122
- end
123
- end
124
-
125
- end
@@ -1,15 +0,0 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile ~/.gitignore_global
6
-
7
- # Ignore bundler config
8
- /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
-
13
- # Ignore all logfiles and tempfiles.
14
- /log/*.log
15
- /tmp
data/spec/dummy/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source :gemcutter
2
- gem "rails", "=3.2.21"
3
- gem "i18n", ">= 0.5", "< 0.7"
4
- gem "sqlite3-ruby", :require => "sqlite3"
5
- gem "rake"
6
- gem "will_paginate", "~> 3.0.pre2"
7
- gem "paper_trail_manager", :path => __FILE__ + "/../../../"
8
- gem 'factory_girl_rails', '~> 1.7.0'
9
- gem 'rspec-rails', '~> 2.11.0'