rails-services 0.1.5
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.
- data/.document +5 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +20 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +63 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/lib/rails-services.rb +92 -0
- data/rails-services.gemspec +278 -0
- data/test/helper.rb +18 -0
- data/test/rails_app_v2/README +243 -0
- data/test/rails_app_v2/Rakefile +10 -0
- data/test/rails_app_v2/app/controllers/application_controller.rb +10 -0
- data/test/rails_app_v2/app/controllers/authors_controller.rb +83 -0
- data/test/rails_app_v2/app/controllers/posts_controller.rb +83 -0
- data/test/rails_app_v2/app/helpers/application_helper.rb +3 -0
- data/test/rails_app_v2/app/helpers/authors_helper.rb +2 -0
- data/test/rails_app_v2/app/helpers/posts_helper.rb +2 -0
- data/test/rails_app_v2/app/models/author.rb +3 -0
- data/test/rails_app_v2/app/models/post.rb +3 -0
- data/test/rails_app_v2/app/views/authors/edit.html.erb +16 -0
- data/test/rails_app_v2/app/views/authors/index.html.erb +20 -0
- data/test/rails_app_v2/app/views/authors/new.html.erb +15 -0
- data/test/rails_app_v2/app/views/authors/show.html.erb +8 -0
- data/test/rails_app_v2/app/views/layouts/authors.html.erb +17 -0
- data/test/rails_app_v2/app/views/layouts/posts.html.erb +17 -0
- data/test/rails_app_v2/app/views/posts/edit.html.erb +20 -0
- data/test/rails_app_v2/app/views/posts/index.html.erb +22 -0
- data/test/rails_app_v2/app/views/posts/new.html.erb +19 -0
- data/test/rails_app_v2/app/views/posts/show.html.erb +13 -0
- data/test/rails_app_v2/config/boot.rb +110 -0
- data/test/rails_app_v2/config/database.yml +22 -0
- data/test/rails_app_v2/config/environment.rb +52 -0
- data/test/rails_app_v2/config/environments/development.rb +17 -0
- data/test/rails_app_v2/config/environments/production.rb +28 -0
- data/test/rails_app_v2/config/environments/test.rb +28 -0
- data/test/rails_app_v2/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app_v2/config/initializers/cookie_verification_secret.rb +7 -0
- data/test/rails_app_v2/config/initializers/inflections.rb +10 -0
- data/test/rails_app_v2/config/initializers/jdbc.rb +7 -0
- data/test/rails_app_v2/config/initializers/mime_types.rb +5 -0
- data/test/rails_app_v2/config/initializers/new_rails_defaults.rb +21 -0
- data/test/rails_app_v2/config/initializers/session_store.rb +15 -0
- data/test/rails_app_v2/config/locales/en.yml +5 -0
- data/test/rails_app_v2/config/routes.rb +52 -0
- data/test/rails_app_v2/db/development.sqlite3 +0 -0
- data/test/rails_app_v2/db/migrate/20110128215001_create_authors.rb +13 -0
- data/test/rails_app_v2/db/migrate/20110128215003_create_posts.rb +14 -0
- data/test/rails_app_v2/db/schema.rb +27 -0
- data/test/rails_app_v2/db/seeds.rb +7 -0
- data/test/rails_app_v2/lib/tasks/jdbc.rake +8 -0
- data/test/rails_app_v2/log/development.log +64 -0
- data/test/rails_app_v2/log/production.log +0 -0
- data/test/rails_app_v2/log/server.log +0 -0
- data/test/rails_app_v2/log/test.log +0 -0
- data/test/rails_app_v2/public/404.html +30 -0
- data/test/rails_app_v2/public/422.html +30 -0
- data/test/rails_app_v2/public/500.html +30 -0
- data/test/rails_app_v2/public/favicon.ico +0 -0
- data/test/rails_app_v2/public/images/rails.png +0 -0
- data/test/rails_app_v2/public/index.html +275 -0
- data/test/rails_app_v2/public/javascripts/application.js +2 -0
- data/test/rails_app_v2/public/javascripts/controls.js +963 -0
- data/test/rails_app_v2/public/javascripts/dragdrop.js +973 -0
- data/test/rails_app_v2/public/javascripts/effects.js +1128 -0
- data/test/rails_app_v2/public/javascripts/prototype.js +4320 -0
- data/test/rails_app_v2/public/robots.txt +5 -0
- data/test/rails_app_v2/public/stylesheets/scaffold.css +54 -0
- data/test/rails_app_v2/script/about +4 -0
- data/test/rails_app_v2/script/console +3 -0
- data/test/rails_app_v2/script/dbconsole +3 -0
- data/test/rails_app_v2/script/destroy +3 -0
- data/test/rails_app_v2/script/generate +3 -0
- data/test/rails_app_v2/script/performance/benchmarker +3 -0
- data/test/rails_app_v2/script/performance/profiler +3 -0
- data/test/rails_app_v2/script/plugin +3 -0
- data/test/rails_app_v2/script/runner +3 -0
- data/test/rails_app_v2/script/server +3 -0
- data/test/rails_app_v2/test/fixtures/authors.yml +7 -0
- data/test/rails_app_v2/test/fixtures/posts.yml +9 -0
- data/test/rails_app_v2/test/functional/authors_controller_test.rb +45 -0
- data/test/rails_app_v2/test/functional/posts_controller_test.rb +45 -0
- data/test/rails_app_v2/test/performance/browsing_test.rb +9 -0
- data/test/rails_app_v2/test/test_helper.rb +38 -0
- data/test/rails_app_v2/test/unit/author_test.rb +8 -0
- data/test/rails_app_v2/test/unit/helpers/authors_helper_test.rb +4 -0
- data/test/rails_app_v2/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/rails_app_v2/test/unit/post_test.rb +8 -0
- data/test/rails_app_v3/.gitignore +4 -0
- data/test/rails_app_v3/Gemfile +40 -0
- data/test/rails_app_v3/Gemfile.lock +77 -0
- data/test/rails_app_v3/README +256 -0
- data/test/rails_app_v3/Rakefile +7 -0
- data/test/rails_app_v3/app/controllers/application_controller.rb +3 -0
- data/test/rails_app_v3/app/controllers/authors_controller.rb +83 -0
- data/test/rails_app_v3/app/controllers/posts_controller.rb +83 -0
- data/test/rails_app_v3/app/helpers/application_helper.rb +2 -0
- data/test/rails_app_v3/app/helpers/authors_helper.rb +2 -0
- data/test/rails_app_v3/app/helpers/posts_helper.rb +2 -0
- data/test/rails_app_v3/app/models/author.rb +3 -0
- data/test/rails_app_v3/app/models/post.rb +3 -0
- data/test/rails_app_v3/app/views/authors/_form.html.erb +21 -0
- data/test/rails_app_v3/app/views/authors/edit.html.erb +6 -0
- data/test/rails_app_v3/app/views/authors/index.html.erb +23 -0
- data/test/rails_app_v3/app/views/authors/new.html.erb +5 -0
- data/test/rails_app_v3/app/views/authors/show.html.erb +10 -0
- data/test/rails_app_v3/app/views/layouts/application.html.erb +14 -0
- data/test/rails_app_v3/app/views/posts/_form.html.erb +25 -0
- data/test/rails_app_v3/app/views/posts/edit.html.erb +6 -0
- data/test/rails_app_v3/app/views/posts/index.html.erb +25 -0
- data/test/rails_app_v3/app/views/posts/new.html.erb +5 -0
- data/test/rails_app_v3/app/views/posts/show.html.erb +15 -0
- data/test/rails_app_v3/config.ru +4 -0
- data/test/rails_app_v3/config/application.rb +42 -0
- data/test/rails_app_v3/config/boot.rb +13 -0
- data/test/rails_app_v3/config/database.yml +22 -0
- data/test/rails_app_v3/config/environment.rb +5 -0
- data/test/rails_app_v3/config/environments/development.rb +26 -0
- data/test/rails_app_v3/config/environments/production.rb +49 -0
- data/test/rails_app_v3/config/environments/test.rb +35 -0
- data/test/rails_app_v3/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app_v3/config/initializers/inflections.rb +10 -0
- data/test/rails_app_v3/config/initializers/mime_types.rb +5 -0
- data/test/rails_app_v3/config/initializers/secret_token.rb +7 -0
- data/test/rails_app_v3/config/initializers/session_store.rb +8 -0
- data/test/rails_app_v3/config/locales/en.yml +5 -0
- data/test/rails_app_v3/config/routes.rb +67 -0
- data/test/rails_app_v3/db/migrate/20110128215656_create_posts.rb +14 -0
- data/test/rails_app_v3/db/migrate/20110128215713_create_authors.rb +13 -0
- data/test/rails_app_v3/db/schema.rb +28 -0
- data/test/rails_app_v3/db/seeds.rb +7 -0
- data/test/rails_app_v3/lib/tasks/.gitkeep +0 -0
- data/test/rails_app_v3/public/404.html +26 -0
- data/test/rails_app_v3/public/422.html +26 -0
- data/test/rails_app_v3/public/500.html +26 -0
- data/test/rails_app_v3/public/favicon.ico +0 -0
- data/test/rails_app_v3/public/images/rails.png +0 -0
- data/test/rails_app_v3/public/index.html +239 -0
- data/test/rails_app_v3/public/javascripts/application.js +2 -0
- data/test/rails_app_v3/public/javascripts/controls.js +965 -0
- data/test/rails_app_v3/public/javascripts/dragdrop.js +974 -0
- data/test/rails_app_v3/public/javascripts/effects.js +1123 -0
- data/test/rails_app_v3/public/javascripts/prototype.js +6001 -0
- data/test/rails_app_v3/public/javascripts/rails.js +175 -0
- data/test/rails_app_v3/public/robots.txt +5 -0
- data/test/rails_app_v3/public/stylesheets/.gitkeep +0 -0
- data/test/rails_app_v3/public/stylesheets/scaffold.css +56 -0
- data/test/rails_app_v3/script/rails +6 -0
- data/test/rails_app_v3/test/fixtures/authors.yml +7 -0
- data/test/rails_app_v3/test/fixtures/posts.yml +9 -0
- data/test/rails_app_v3/test/functional/authors_controller_test.rb +49 -0
- data/test/rails_app_v3/test/functional/posts_controller_test.rb +49 -0
- data/test/rails_app_v3/test/performance/browsing_test.rb +9 -0
- data/test/rails_app_v3/test/test_helper.rb +13 -0
- data/test/rails_app_v3/test/unit/author_test.rb +8 -0
- data/test/rails_app_v3/test/unit/helpers/authors_helper_test.rb +4 -0
- data/test/rails_app_v3/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/rails_app_v3/test/unit/post_test.rb +8 -0
- data/test/rails_app_v3/vendor/plugins/.gitkeep +0 -0
- data/test/test_rails-services.rb +7 -0
- metadata +346 -0
@@ -0,0 +1,175 @@
|
|
1
|
+
(function() {
|
2
|
+
// Technique from Juriy Zaytsev
|
3
|
+
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
|
4
|
+
function isEventSupported(eventName) {
|
5
|
+
var el = document.createElement('div');
|
6
|
+
eventName = 'on' + eventName;
|
7
|
+
var isSupported = (eventName in el);
|
8
|
+
if (!isSupported) {
|
9
|
+
el.setAttribute(eventName, 'return;');
|
10
|
+
isSupported = typeof el[eventName] == 'function';
|
11
|
+
}
|
12
|
+
el = null;
|
13
|
+
return isSupported;
|
14
|
+
}
|
15
|
+
|
16
|
+
function isForm(element) {
|
17
|
+
return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
|
18
|
+
}
|
19
|
+
|
20
|
+
function isInput(element) {
|
21
|
+
if (Object.isElement(element)) {
|
22
|
+
var name = element.nodeName.toUpperCase()
|
23
|
+
return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
|
24
|
+
}
|
25
|
+
else return false
|
26
|
+
}
|
27
|
+
|
28
|
+
var submitBubbles = isEventSupported('submit'),
|
29
|
+
changeBubbles = isEventSupported('change')
|
30
|
+
|
31
|
+
if (!submitBubbles || !changeBubbles) {
|
32
|
+
// augment the Event.Handler class to observe custom events when needed
|
33
|
+
Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
|
34
|
+
function(init, element, eventName, selector, callback) {
|
35
|
+
init(element, eventName, selector, callback)
|
36
|
+
// is the handler being attached to an element that doesn't support this event?
|
37
|
+
if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
|
38
|
+
(!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
|
39
|
+
// "submit" => "emulated:submit"
|
40
|
+
this.eventName = 'emulated:' + this.eventName
|
41
|
+
}
|
42
|
+
}
|
43
|
+
)
|
44
|
+
}
|
45
|
+
|
46
|
+
if (!submitBubbles) {
|
47
|
+
// discover forms on the page by observing focus events which always bubble
|
48
|
+
document.on('focusin', 'form', function(focusEvent, form) {
|
49
|
+
// special handler for the real "submit" event (one-time operation)
|
50
|
+
if (!form.retrieve('emulated:submit')) {
|
51
|
+
form.on('submit', function(submitEvent) {
|
52
|
+
var emulated = form.fire('emulated:submit', submitEvent, true)
|
53
|
+
// if custom event received preventDefault, cancel the real one too
|
54
|
+
if (emulated.returnValue === false) submitEvent.preventDefault()
|
55
|
+
})
|
56
|
+
form.store('emulated:submit', true)
|
57
|
+
}
|
58
|
+
})
|
59
|
+
}
|
60
|
+
|
61
|
+
if (!changeBubbles) {
|
62
|
+
// discover form inputs on the page
|
63
|
+
document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
|
64
|
+
// special handler for real "change" events
|
65
|
+
if (!input.retrieve('emulated:change')) {
|
66
|
+
input.on('change', function(changeEvent) {
|
67
|
+
input.fire('emulated:change', changeEvent, true)
|
68
|
+
})
|
69
|
+
input.store('emulated:change', true)
|
70
|
+
}
|
71
|
+
})
|
72
|
+
}
|
73
|
+
|
74
|
+
function handleRemote(element) {
|
75
|
+
var method, url, params;
|
76
|
+
|
77
|
+
var event = element.fire("ajax:before");
|
78
|
+
if (event.stopped) return false;
|
79
|
+
|
80
|
+
if (element.tagName.toLowerCase() === 'form') {
|
81
|
+
method = element.readAttribute('method') || 'post';
|
82
|
+
url = element.readAttribute('action');
|
83
|
+
params = element.serialize();
|
84
|
+
} else {
|
85
|
+
method = element.readAttribute('data-method') || 'get';
|
86
|
+
url = element.readAttribute('href');
|
87
|
+
params = {};
|
88
|
+
}
|
89
|
+
|
90
|
+
new Ajax.Request(url, {
|
91
|
+
method: method,
|
92
|
+
parameters: params,
|
93
|
+
evalScripts: true,
|
94
|
+
|
95
|
+
onComplete: function(request) { element.fire("ajax:complete", request); },
|
96
|
+
onSuccess: function(request) { element.fire("ajax:success", request); },
|
97
|
+
onFailure: function(request) { element.fire("ajax:failure", request); }
|
98
|
+
});
|
99
|
+
|
100
|
+
element.fire("ajax:after");
|
101
|
+
}
|
102
|
+
|
103
|
+
function handleMethod(element) {
|
104
|
+
var method = element.readAttribute('data-method'),
|
105
|
+
url = element.readAttribute('href'),
|
106
|
+
csrf_param = $$('meta[name=csrf-param]')[0],
|
107
|
+
csrf_token = $$('meta[name=csrf-token]')[0];
|
108
|
+
|
109
|
+
var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
|
110
|
+
element.parentNode.insert(form);
|
111
|
+
|
112
|
+
if (method !== 'post') {
|
113
|
+
var field = new Element('input', { type: 'hidden', name: '_method', value: method });
|
114
|
+
form.insert(field);
|
115
|
+
}
|
116
|
+
|
117
|
+
if (csrf_param) {
|
118
|
+
var param = csrf_param.readAttribute('content'),
|
119
|
+
token = csrf_token.readAttribute('content'),
|
120
|
+
field = new Element('input', { type: 'hidden', name: param, value: token });
|
121
|
+
form.insert(field);
|
122
|
+
}
|
123
|
+
|
124
|
+
form.submit();
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
document.on("click", "*[data-confirm]", function(event, element) {
|
129
|
+
var message = element.readAttribute('data-confirm');
|
130
|
+
if (!confirm(message)) event.stop();
|
131
|
+
});
|
132
|
+
|
133
|
+
document.on("click", "a[data-remote]", function(event, element) {
|
134
|
+
if (event.stopped) return;
|
135
|
+
handleRemote(element);
|
136
|
+
event.stop();
|
137
|
+
});
|
138
|
+
|
139
|
+
document.on("click", "a[data-method]", function(event, element) {
|
140
|
+
if (event.stopped) return;
|
141
|
+
handleMethod(element);
|
142
|
+
event.stop();
|
143
|
+
});
|
144
|
+
|
145
|
+
document.on("submit", function(event) {
|
146
|
+
var element = event.findElement(),
|
147
|
+
message = element.readAttribute('data-confirm');
|
148
|
+
if (message && !confirm(message)) {
|
149
|
+
event.stop();
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
|
153
|
+
var inputs = element.select("input[type=submit][data-disable-with]");
|
154
|
+
inputs.each(function(input) {
|
155
|
+
input.disabled = true;
|
156
|
+
input.writeAttribute('data-original-value', input.value);
|
157
|
+
input.value = input.readAttribute('data-disable-with');
|
158
|
+
});
|
159
|
+
|
160
|
+
var element = event.findElement("form[data-remote]");
|
161
|
+
if (element) {
|
162
|
+
handleRemote(element);
|
163
|
+
event.stop();
|
164
|
+
}
|
165
|
+
});
|
166
|
+
|
167
|
+
document.on("ajax:after", "form", function(event, element) {
|
168
|
+
var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
|
169
|
+
inputs.each(function(input) {
|
170
|
+
input.value = input.readAttribute('data-original-value');
|
171
|
+
input.removeAttribute('data-original-value');
|
172
|
+
input.disabled = false;
|
173
|
+
});
|
174
|
+
});
|
175
|
+
})();
|
File without changes
|
@@ -0,0 +1,56 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
div.field, div.actions {
|
20
|
+
margin-bottom: 10px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#notice {
|
24
|
+
color: green;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors {
|
28
|
+
padding: 2px;
|
29
|
+
background-color: red;
|
30
|
+
display: table;
|
31
|
+
}
|
32
|
+
|
33
|
+
#error_explanation {
|
34
|
+
width: 450px;
|
35
|
+
border: 2px solid red;
|
36
|
+
padding: 7px;
|
37
|
+
padding-bottom: 0;
|
38
|
+
margin-bottom: 20px;
|
39
|
+
background-color: #f0f0f0;
|
40
|
+
}
|
41
|
+
|
42
|
+
#error_explanation h2 {
|
43
|
+
text-align: left;
|
44
|
+
font-weight: bold;
|
45
|
+
padding: 5px 5px 5px 15px;
|
46
|
+
font-size: 12px;
|
47
|
+
margin: -7px;
|
48
|
+
margin-bottom: 0px;
|
49
|
+
background-color: #c00;
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
#error_explanation ul li {
|
54
|
+
font-size: 12px;
|
55
|
+
list-style: square;
|
56
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class AuthorsControllerTest < ActionController::TestCase
|
4
|
+
setup do
|
5
|
+
@author = authors(:one)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "should get index" do
|
9
|
+
get :index
|
10
|
+
assert_response :success
|
11
|
+
assert_not_nil assigns(:authors)
|
12
|
+
end
|
13
|
+
|
14
|
+
test "should get new" do
|
15
|
+
get :new
|
16
|
+
assert_response :success
|
17
|
+
end
|
18
|
+
|
19
|
+
test "should create author" do
|
20
|
+
assert_difference('Author.count') do
|
21
|
+
post :create, :author => @author.attributes
|
22
|
+
end
|
23
|
+
|
24
|
+
assert_redirected_to author_path(assigns(:author))
|
25
|
+
end
|
26
|
+
|
27
|
+
test "should show author" do
|
28
|
+
get :show, :id => @author.to_param
|
29
|
+
assert_response :success
|
30
|
+
end
|
31
|
+
|
32
|
+
test "should get edit" do
|
33
|
+
get :edit, :id => @author.to_param
|
34
|
+
assert_response :success
|
35
|
+
end
|
36
|
+
|
37
|
+
test "should update author" do
|
38
|
+
put :update, :id => @author.to_param, :author => @author.attributes
|
39
|
+
assert_redirected_to author_path(assigns(:author))
|
40
|
+
end
|
41
|
+
|
42
|
+
test "should destroy author" do
|
43
|
+
assert_difference('Author.count', -1) do
|
44
|
+
delete :destroy, :id => @author.to_param
|
45
|
+
end
|
46
|
+
|
47
|
+
assert_redirected_to authors_path
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PostsControllerTest < ActionController::TestCase
|
4
|
+
setup do
|
5
|
+
@post = posts(:one)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "should get index" do
|
9
|
+
get :index
|
10
|
+
assert_response :success
|
11
|
+
assert_not_nil assigns(:posts)
|
12
|
+
end
|
13
|
+
|
14
|
+
test "should get new" do
|
15
|
+
get :new
|
16
|
+
assert_response :success
|
17
|
+
end
|
18
|
+
|
19
|
+
test "should create post" do
|
20
|
+
assert_difference('Post.count') do
|
21
|
+
post :create, :post => @post.attributes
|
22
|
+
end
|
23
|
+
|
24
|
+
assert_redirected_to post_path(assigns(:post))
|
25
|
+
end
|
26
|
+
|
27
|
+
test "should show post" do
|
28
|
+
get :show, :id => @post.to_param
|
29
|
+
assert_response :success
|
30
|
+
end
|
31
|
+
|
32
|
+
test "should get edit" do
|
33
|
+
get :edit, :id => @post.to_param
|
34
|
+
assert_response :success
|
35
|
+
end
|
36
|
+
|
37
|
+
test "should update post" do
|
38
|
+
put :update, :id => @post.to_param, :post => @post.attributes
|
39
|
+
assert_redirected_to post_path(assigns(:post))
|
40
|
+
end
|
41
|
+
|
42
|
+
test "should destroy post" do
|
43
|
+
assert_difference('Post.count', -1) do
|
44
|
+
delete :destroy, :id => @post.to_param
|
45
|
+
end
|
46
|
+
|
47
|
+
assert_redirected_to posts_path
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path('../../config/environment', __FILE__)
|
3
|
+
require 'rails/test_help'
|
4
|
+
|
5
|
+
class ActiveSupport::TestCase
|
6
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
7
|
+
#
|
8
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
+
# -- they do not yet inherit this setting
|
10
|
+
fixtures :all
|
11
|
+
|
12
|
+
# Add more helper methods to be used by all tests here...
|
13
|
+
end
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,346 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails-services
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Bernardo Silva
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-01-28 00:00:00 -06:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: shoulda
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :development
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 1
|
42
|
+
- 0
|
43
|
+
- 0
|
44
|
+
version: 1.0.0
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: jeweler
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 5
|
58
|
+
- 2
|
59
|
+
version: 1.5.2
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rcov
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
version: "0"
|
73
|
+
type: :development
|
74
|
+
prerelease: false
|
75
|
+
version_requirements: *id004
|
76
|
+
description: Services Description for Rails 3.0.3+ or 2.3.8+
|
77
|
+
email: bernardo.silva@gmail.com
|
78
|
+
executables: []
|
79
|
+
|
80
|
+
extensions: []
|
81
|
+
|
82
|
+
extra_rdoc_files:
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.rdoc
|
85
|
+
files:
|
86
|
+
- .document
|
87
|
+
- Gemfile
|
88
|
+
- Gemfile.lock
|
89
|
+
- LICENSE.txt
|
90
|
+
- README.rdoc
|
91
|
+
- Rakefile
|
92
|
+
- VERSION
|
93
|
+
- lib/rails-services.rb
|
94
|
+
- rails-services.gemspec
|
95
|
+
- test/helper.rb
|
96
|
+
- test/rails_app_v2/README
|
97
|
+
- test/rails_app_v2/Rakefile
|
98
|
+
- test/rails_app_v2/app/controllers/application_controller.rb
|
99
|
+
- test/rails_app_v2/app/controllers/authors_controller.rb
|
100
|
+
- test/rails_app_v2/app/controllers/posts_controller.rb
|
101
|
+
- test/rails_app_v2/app/helpers/application_helper.rb
|
102
|
+
- test/rails_app_v2/app/helpers/authors_helper.rb
|
103
|
+
- test/rails_app_v2/app/helpers/posts_helper.rb
|
104
|
+
- test/rails_app_v2/app/models/author.rb
|
105
|
+
- test/rails_app_v2/app/models/post.rb
|
106
|
+
- test/rails_app_v2/app/views/authors/edit.html.erb
|
107
|
+
- test/rails_app_v2/app/views/authors/index.html.erb
|
108
|
+
- test/rails_app_v2/app/views/authors/new.html.erb
|
109
|
+
- test/rails_app_v2/app/views/authors/show.html.erb
|
110
|
+
- test/rails_app_v2/app/views/layouts/authors.html.erb
|
111
|
+
- test/rails_app_v2/app/views/layouts/posts.html.erb
|
112
|
+
- test/rails_app_v2/app/views/posts/edit.html.erb
|
113
|
+
- test/rails_app_v2/app/views/posts/index.html.erb
|
114
|
+
- test/rails_app_v2/app/views/posts/new.html.erb
|
115
|
+
- test/rails_app_v2/app/views/posts/show.html.erb
|
116
|
+
- test/rails_app_v2/config/boot.rb
|
117
|
+
- test/rails_app_v2/config/database.yml
|
118
|
+
- test/rails_app_v2/config/environment.rb
|
119
|
+
- test/rails_app_v2/config/environments/development.rb
|
120
|
+
- test/rails_app_v2/config/environments/production.rb
|
121
|
+
- test/rails_app_v2/config/environments/test.rb
|
122
|
+
- test/rails_app_v2/config/initializers/backtrace_silencers.rb
|
123
|
+
- test/rails_app_v2/config/initializers/cookie_verification_secret.rb
|
124
|
+
- test/rails_app_v2/config/initializers/inflections.rb
|
125
|
+
- test/rails_app_v2/config/initializers/jdbc.rb
|
126
|
+
- test/rails_app_v2/config/initializers/mime_types.rb
|
127
|
+
- test/rails_app_v2/config/initializers/new_rails_defaults.rb
|
128
|
+
- test/rails_app_v2/config/initializers/session_store.rb
|
129
|
+
- test/rails_app_v2/config/locales/en.yml
|
130
|
+
- test/rails_app_v2/config/routes.rb
|
131
|
+
- test/rails_app_v2/db/development.sqlite3
|
132
|
+
- test/rails_app_v2/db/migrate/20110128215001_create_authors.rb
|
133
|
+
- test/rails_app_v2/db/migrate/20110128215003_create_posts.rb
|
134
|
+
- test/rails_app_v2/db/schema.rb
|
135
|
+
- test/rails_app_v2/db/seeds.rb
|
136
|
+
- test/rails_app_v2/lib/tasks/jdbc.rake
|
137
|
+
- test/rails_app_v2/log/development.log
|
138
|
+
- test/rails_app_v2/log/production.log
|
139
|
+
- test/rails_app_v2/log/server.log
|
140
|
+
- test/rails_app_v2/log/test.log
|
141
|
+
- test/rails_app_v2/public/404.html
|
142
|
+
- test/rails_app_v2/public/422.html
|
143
|
+
- test/rails_app_v2/public/500.html
|
144
|
+
- test/rails_app_v2/public/favicon.ico
|
145
|
+
- test/rails_app_v2/public/images/rails.png
|
146
|
+
- test/rails_app_v2/public/index.html
|
147
|
+
- test/rails_app_v2/public/javascripts/application.js
|
148
|
+
- test/rails_app_v2/public/javascripts/controls.js
|
149
|
+
- test/rails_app_v2/public/javascripts/dragdrop.js
|
150
|
+
- test/rails_app_v2/public/javascripts/effects.js
|
151
|
+
- test/rails_app_v2/public/javascripts/prototype.js
|
152
|
+
- test/rails_app_v2/public/robots.txt
|
153
|
+
- test/rails_app_v2/public/stylesheets/scaffold.css
|
154
|
+
- test/rails_app_v2/script/about
|
155
|
+
- test/rails_app_v2/script/console
|
156
|
+
- test/rails_app_v2/script/dbconsole
|
157
|
+
- test/rails_app_v2/script/destroy
|
158
|
+
- test/rails_app_v2/script/generate
|
159
|
+
- test/rails_app_v2/script/performance/benchmarker
|
160
|
+
- test/rails_app_v2/script/performance/profiler
|
161
|
+
- test/rails_app_v2/script/plugin
|
162
|
+
- test/rails_app_v2/script/runner
|
163
|
+
- test/rails_app_v2/script/server
|
164
|
+
- test/rails_app_v2/test/fixtures/authors.yml
|
165
|
+
- test/rails_app_v2/test/fixtures/posts.yml
|
166
|
+
- test/rails_app_v2/test/functional/authors_controller_test.rb
|
167
|
+
- test/rails_app_v2/test/functional/posts_controller_test.rb
|
168
|
+
- test/rails_app_v2/test/performance/browsing_test.rb
|
169
|
+
- test/rails_app_v2/test/test_helper.rb
|
170
|
+
- test/rails_app_v2/test/unit/author_test.rb
|
171
|
+
- test/rails_app_v2/test/unit/helpers/authors_helper_test.rb
|
172
|
+
- test/rails_app_v2/test/unit/helpers/posts_helper_test.rb
|
173
|
+
- test/rails_app_v2/test/unit/post_test.rb
|
174
|
+
- test/rails_app_v3/.gitignore
|
175
|
+
- test/rails_app_v3/Gemfile
|
176
|
+
- test/rails_app_v3/Gemfile.lock
|
177
|
+
- test/rails_app_v3/README
|
178
|
+
- test/rails_app_v3/Rakefile
|
179
|
+
- test/rails_app_v3/app/controllers/application_controller.rb
|
180
|
+
- test/rails_app_v3/app/controllers/authors_controller.rb
|
181
|
+
- test/rails_app_v3/app/controllers/posts_controller.rb
|
182
|
+
- test/rails_app_v3/app/helpers/application_helper.rb
|
183
|
+
- test/rails_app_v3/app/helpers/authors_helper.rb
|
184
|
+
- test/rails_app_v3/app/helpers/posts_helper.rb
|
185
|
+
- test/rails_app_v3/app/models/author.rb
|
186
|
+
- test/rails_app_v3/app/models/post.rb
|
187
|
+
- test/rails_app_v3/app/views/authors/_form.html.erb
|
188
|
+
- test/rails_app_v3/app/views/authors/edit.html.erb
|
189
|
+
- test/rails_app_v3/app/views/authors/index.html.erb
|
190
|
+
- test/rails_app_v3/app/views/authors/new.html.erb
|
191
|
+
- test/rails_app_v3/app/views/authors/show.html.erb
|
192
|
+
- test/rails_app_v3/app/views/layouts/application.html.erb
|
193
|
+
- test/rails_app_v3/app/views/posts/_form.html.erb
|
194
|
+
- test/rails_app_v3/app/views/posts/edit.html.erb
|
195
|
+
- test/rails_app_v3/app/views/posts/index.html.erb
|
196
|
+
- test/rails_app_v3/app/views/posts/new.html.erb
|
197
|
+
- test/rails_app_v3/app/views/posts/show.html.erb
|
198
|
+
- test/rails_app_v3/config.ru
|
199
|
+
- test/rails_app_v3/config/application.rb
|
200
|
+
- test/rails_app_v3/config/boot.rb
|
201
|
+
- test/rails_app_v3/config/database.yml
|
202
|
+
- test/rails_app_v3/config/environment.rb
|
203
|
+
- test/rails_app_v3/config/environments/development.rb
|
204
|
+
- test/rails_app_v3/config/environments/production.rb
|
205
|
+
- test/rails_app_v3/config/environments/test.rb
|
206
|
+
- test/rails_app_v3/config/initializers/backtrace_silencers.rb
|
207
|
+
- test/rails_app_v3/config/initializers/inflections.rb
|
208
|
+
- test/rails_app_v3/config/initializers/mime_types.rb
|
209
|
+
- test/rails_app_v3/config/initializers/secret_token.rb
|
210
|
+
- test/rails_app_v3/config/initializers/session_store.rb
|
211
|
+
- test/rails_app_v3/config/locales/en.yml
|
212
|
+
- test/rails_app_v3/config/routes.rb
|
213
|
+
- test/rails_app_v3/db/migrate/20110128215656_create_posts.rb
|
214
|
+
- test/rails_app_v3/db/migrate/20110128215713_create_authors.rb
|
215
|
+
- test/rails_app_v3/db/schema.rb
|
216
|
+
- test/rails_app_v3/db/seeds.rb
|
217
|
+
- test/rails_app_v3/lib/tasks/.gitkeep
|
218
|
+
- test/rails_app_v3/public/404.html
|
219
|
+
- test/rails_app_v3/public/422.html
|
220
|
+
- test/rails_app_v3/public/500.html
|
221
|
+
- test/rails_app_v3/public/favicon.ico
|
222
|
+
- test/rails_app_v3/public/images/rails.png
|
223
|
+
- test/rails_app_v3/public/index.html
|
224
|
+
- test/rails_app_v3/public/javascripts/application.js
|
225
|
+
- test/rails_app_v3/public/javascripts/controls.js
|
226
|
+
- test/rails_app_v3/public/javascripts/dragdrop.js
|
227
|
+
- test/rails_app_v3/public/javascripts/effects.js
|
228
|
+
- test/rails_app_v3/public/javascripts/prototype.js
|
229
|
+
- test/rails_app_v3/public/javascripts/rails.js
|
230
|
+
- test/rails_app_v3/public/robots.txt
|
231
|
+
- test/rails_app_v3/public/stylesheets/.gitkeep
|
232
|
+
- test/rails_app_v3/public/stylesheets/scaffold.css
|
233
|
+
- test/rails_app_v3/script/rails
|
234
|
+
- test/rails_app_v3/test/fixtures/authors.yml
|
235
|
+
- test/rails_app_v3/test/fixtures/posts.yml
|
236
|
+
- test/rails_app_v3/test/functional/authors_controller_test.rb
|
237
|
+
- test/rails_app_v3/test/functional/posts_controller_test.rb
|
238
|
+
- test/rails_app_v3/test/performance/browsing_test.rb
|
239
|
+
- test/rails_app_v3/test/test_helper.rb
|
240
|
+
- test/rails_app_v3/test/unit/author_test.rb
|
241
|
+
- test/rails_app_v3/test/unit/helpers/authors_helper_test.rb
|
242
|
+
- test/rails_app_v3/test/unit/helpers/posts_helper_test.rb
|
243
|
+
- test/rails_app_v3/test/unit/post_test.rb
|
244
|
+
- test/rails_app_v3/vendor/plugins/.gitkeep
|
245
|
+
- test/test_rails-services.rb
|
246
|
+
has_rdoc: true
|
247
|
+
homepage: http://github.com/bsas/rails-services
|
248
|
+
licenses:
|
249
|
+
- MIT
|
250
|
+
post_install_message:
|
251
|
+
rdoc_options: []
|
252
|
+
|
253
|
+
require_paths:
|
254
|
+
- lib
|
255
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
256
|
+
none: false
|
257
|
+
requirements:
|
258
|
+
- - ">="
|
259
|
+
- !ruby/object:Gem::Version
|
260
|
+
hash: 579167951
|
261
|
+
segments:
|
262
|
+
- 0
|
263
|
+
version: "0"
|
264
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
265
|
+
none: false
|
266
|
+
requirements:
|
267
|
+
- - ">="
|
268
|
+
- !ruby/object:Gem::Version
|
269
|
+
segments:
|
270
|
+
- 0
|
271
|
+
version: "0"
|
272
|
+
requirements: []
|
273
|
+
|
274
|
+
rubyforge_project:
|
275
|
+
rubygems_version: 1.3.7
|
276
|
+
signing_key:
|
277
|
+
specification_version: 3
|
278
|
+
summary: Services Description for Rails 3.0.3+ or 2.3.8+
|
279
|
+
test_files:
|
280
|
+
- test/helper.rb
|
281
|
+
- test/rails_app_v2/app/controllers/application_controller.rb
|
282
|
+
- test/rails_app_v2/app/controllers/authors_controller.rb
|
283
|
+
- test/rails_app_v2/app/controllers/posts_controller.rb
|
284
|
+
- test/rails_app_v2/app/helpers/application_helper.rb
|
285
|
+
- test/rails_app_v2/app/helpers/authors_helper.rb
|
286
|
+
- test/rails_app_v2/app/helpers/posts_helper.rb
|
287
|
+
- test/rails_app_v2/app/models/author.rb
|
288
|
+
- test/rails_app_v2/app/models/post.rb
|
289
|
+
- test/rails_app_v2/config/boot.rb
|
290
|
+
- test/rails_app_v2/config/environment.rb
|
291
|
+
- test/rails_app_v2/config/environments/development.rb
|
292
|
+
- test/rails_app_v2/config/environments/production.rb
|
293
|
+
- test/rails_app_v2/config/environments/test.rb
|
294
|
+
- test/rails_app_v2/config/initializers/backtrace_silencers.rb
|
295
|
+
- test/rails_app_v2/config/initializers/cookie_verification_secret.rb
|
296
|
+
- test/rails_app_v2/config/initializers/inflections.rb
|
297
|
+
- test/rails_app_v2/config/initializers/jdbc.rb
|
298
|
+
- test/rails_app_v2/config/initializers/mime_types.rb
|
299
|
+
- test/rails_app_v2/config/initializers/new_rails_defaults.rb
|
300
|
+
- test/rails_app_v2/config/initializers/session_store.rb
|
301
|
+
- test/rails_app_v2/config/routes.rb
|
302
|
+
- test/rails_app_v2/db/migrate/20110128215001_create_authors.rb
|
303
|
+
- test/rails_app_v2/db/migrate/20110128215003_create_posts.rb
|
304
|
+
- test/rails_app_v2/db/schema.rb
|
305
|
+
- test/rails_app_v2/db/seeds.rb
|
306
|
+
- test/rails_app_v2/test/functional/authors_controller_test.rb
|
307
|
+
- test/rails_app_v2/test/functional/posts_controller_test.rb
|
308
|
+
- test/rails_app_v2/test/performance/browsing_test.rb
|
309
|
+
- test/rails_app_v2/test/test_helper.rb
|
310
|
+
- test/rails_app_v2/test/unit/author_test.rb
|
311
|
+
- test/rails_app_v2/test/unit/helpers/authors_helper_test.rb
|
312
|
+
- test/rails_app_v2/test/unit/helpers/posts_helper_test.rb
|
313
|
+
- test/rails_app_v2/test/unit/post_test.rb
|
314
|
+
- test/rails_app_v3/app/controllers/application_controller.rb
|
315
|
+
- test/rails_app_v3/app/controllers/authors_controller.rb
|
316
|
+
- test/rails_app_v3/app/controllers/posts_controller.rb
|
317
|
+
- test/rails_app_v3/app/helpers/application_helper.rb
|
318
|
+
- test/rails_app_v3/app/helpers/authors_helper.rb
|
319
|
+
- test/rails_app_v3/app/helpers/posts_helper.rb
|
320
|
+
- test/rails_app_v3/app/models/author.rb
|
321
|
+
- test/rails_app_v3/app/models/post.rb
|
322
|
+
- test/rails_app_v3/config/application.rb
|
323
|
+
- test/rails_app_v3/config/boot.rb
|
324
|
+
- test/rails_app_v3/config/environment.rb
|
325
|
+
- test/rails_app_v3/config/environments/development.rb
|
326
|
+
- test/rails_app_v3/config/environments/production.rb
|
327
|
+
- test/rails_app_v3/config/environments/test.rb
|
328
|
+
- test/rails_app_v3/config/initializers/backtrace_silencers.rb
|
329
|
+
- test/rails_app_v3/config/initializers/inflections.rb
|
330
|
+
- test/rails_app_v3/config/initializers/mime_types.rb
|
331
|
+
- test/rails_app_v3/config/initializers/secret_token.rb
|
332
|
+
- test/rails_app_v3/config/initializers/session_store.rb
|
333
|
+
- test/rails_app_v3/config/routes.rb
|
334
|
+
- test/rails_app_v3/db/migrate/20110128215656_create_posts.rb
|
335
|
+
- test/rails_app_v3/db/migrate/20110128215713_create_authors.rb
|
336
|
+
- test/rails_app_v3/db/schema.rb
|
337
|
+
- test/rails_app_v3/db/seeds.rb
|
338
|
+
- test/rails_app_v3/test/functional/authors_controller_test.rb
|
339
|
+
- test/rails_app_v3/test/functional/posts_controller_test.rb
|
340
|
+
- test/rails_app_v3/test/performance/browsing_test.rb
|
341
|
+
- test/rails_app_v3/test/test_helper.rb
|
342
|
+
- test/rails_app_v3/test/unit/author_test.rb
|
343
|
+
- test/rails_app_v3/test/unit/helpers/authors_helper_test.rb
|
344
|
+
- test/rails_app_v3/test/unit/helpers/posts_helper_test.rb
|
345
|
+
- test/rails_app_v3/test/unit/post_test.rb
|
346
|
+
- test/test_rails-services.rb
|