simple_update_field 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/Gemfile +0 -19
  2. data/Gemfile.lock +0 -150
  3. data/README.creole +102 -0
  4. data/Rakefile +3 -9
  5. data/VERSION +1 -1
  6. data/lib/simple_update_field.rb +0 -8
  7. data/simple_update_field.gemspec +7 -81
  8. data/spec/{lib/simple_update_field_spec.rb → simple_update_field_spec.rb} +2 -1
  9. data/spec/spec_helper.rb +8 -28
  10. metadata +16 -162
  11. data/.rvmrc +0 -1
  12. data/README.rdoc +0 -25
  13. data/app/assets/images/rails.png +0 -0
  14. data/app/assets/javascripts/application.js +0 -14
  15. data/app/assets/stylesheets/application.css +0 -7
  16. data/app/controllers/application_controller.rb +0 -3
  17. data/app/controllers/phrases_controller.rb +0 -12
  18. data/app/helpers/application_helper.rb +0 -2
  19. data/app/mailers/.gitkeep +0 -0
  20. data/app/models/.gitkeep +0 -0
  21. data/app/models/phrase.rb +0 -4
  22. data/app/views/layouts/application.html.erb +0 -14
  23. data/app/views/phrases/_phrase.html.erb +0 -8
  24. data/app/views/phrases/index.html.erb +0 -1
  25. data/config.ru +0 -4
  26. data/config/application.rb +0 -54
  27. data/config/boot.rb +0 -6
  28. data/config/database.yml +0 -25
  29. data/config/environment.rb +0 -5
  30. data/config/environments/development.rb +0 -30
  31. data/config/environments/production.rb +0 -60
  32. data/config/environments/test.rb +0 -42
  33. data/config/initializers/backtrace_silencers.rb +0 -7
  34. data/config/initializers/inflections.rb +0 -10
  35. data/config/initializers/mime_types.rb +0 -5
  36. data/config/initializers/secret_token.rb +0 -7
  37. data/config/initializers/session_store.rb +0 -8
  38. data/config/initializers/wrap_parameters.rb +0 -14
  39. data/config/locales/en.yml +0 -5
  40. data/config/routes.rb +0 -4
  41. data/db/migrate/20120213182817_create_phrases.rb +0 -9
  42. data/db/schema.rb +0 -22
  43. data/db/seeds.rb +0 -7
  44. data/lib/assets/.gitkeep +0 -0
  45. data/lib/tasks/.gitkeep +0 -0
  46. data/lib/tasks/admin.rake +0 -9
  47. data/lib/tasks/jasmine.rake +0 -8
  48. data/script/rails +0 -6
  49. data/spec/controllers/phrases_controller_spec.rb +0 -22
  50. data/spec/javascripts/editable_list_spec.js +0 -411
  51. data/spec/javascripts/helpers/mock-ajax.js +0 -207
  52. data/spec/javascripts/spec.css +0 -3
  53. data/spec/javascripts/spec.js +0 -2
  54. data/spec/models/phrase_spec.rb +0 -11
  55. data/spec/routing/phrase_spec.rb +0 -12
  56. data/spec/routing/root_spec.rb +0 -7
  57. data/spec/views/_phrase.html.erb_spec.rb +0 -9
  58. data/spec/views/index.html.erb_spec.rb +0 -10
@@ -1,207 +0,0 @@
1
- /*
2
- Jasmine-Ajax : a set of helpers for testing AJAX requests under the Jasmine
3
- BDD framework for JavaScript.
4
-
5
- Supports both Prototype.js and jQuery.
6
-
7
- http://github.com/pivotal/jasmine-ajax
8
-
9
- Jasmine Home page: http://pivotal.github.com/jasmine
10
-
11
- Copyright (c) 2008-2010 Pivotal Labs
12
-
13
- Permission is hereby granted, free of charge, to any person obtaining
14
- a copy of this software and associated documentation files (the
15
- "Software"), to deal in the Software without restriction, including
16
- without limitation the rights to use, copy, modify, merge, publish,
17
- distribute, sublicense, and/or sell copies of the Software, and to
18
- permit persons to whom the Software is furnished to do so, subject to
19
- the following conditions:
20
-
21
- The above copyright notice and this permission notice shall be
22
- included in all copies or substantial portions of the Software.
23
-
24
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
-
32
- */
33
-
34
- // Jasmine-Ajax interface
35
- var ajaxRequests = [];
36
-
37
- function mostRecentAjaxRequest() {
38
- if (ajaxRequests.length > 0) {
39
- return ajaxRequests[ajaxRequests.length - 1];
40
- } else {
41
- return null;
42
- }
43
- }
44
-
45
- function clearAjaxRequests() {
46
- ajaxRequests = [];
47
- }
48
-
49
- // Fake XHR for mocking Ajax Requests & Responses
50
- function FakeXMLHttpRequest() {
51
- var extend = Object.extend || $.extend;
52
- extend(this, {
53
- requestHeaders: {},
54
-
55
- open: function() {
56
- this.method = arguments[0];
57
- this.url = arguments[1];
58
- this.readyState = 1;
59
- },
60
-
61
- setRequestHeader: function(header, value) {
62
- this.requestHeaders[header] = value;
63
- },
64
-
65
- abort: function() {
66
- this.readyState = 0;
67
- },
68
-
69
- readyState: 0,
70
-
71
- onreadystatechange: function(isTimeout) {
72
- },
73
-
74
- status: null,
75
-
76
- send: function(data) {
77
- this.params = data;
78
- this.readyState = 2;
79
- },
80
-
81
- getResponseHeader: function(name) {
82
- return this.responseHeaders[name];
83
- },
84
-
85
- getAllResponseHeaders: function() {
86
- var responseHeaders = [];
87
- for (var i in this.responseHeaders) {
88
- if (this.responseHeaders.hasOwnProperty(i)) {
89
- responseHeaders.push(i + ': ' + this.responseHeaders[i]);
90
- }
91
- }
92
- return responseHeaders.join('\r\n');
93
- },
94
-
95
- responseText: null,
96
-
97
- response: function(response) {
98
- this.status = response.status;
99
- this.responseText = response.responseText || "";
100
- this.readyState = 4;
101
- this.responseHeaders = response.responseHeaders ||
102
- {"Content-type": response.contentType || "application/json" };
103
- // uncomment for jquery 1.3.x support
104
- // jasmine.Clock.tick(20);
105
-
106
- this.onreadystatechange();
107
- },
108
- responseTimeout: function() {
109
- this.readyState = 4;
110
- jasmine.Clock.tick(jQuery.ajaxSettings.timeout || 30000);
111
- this.onreadystatechange('timeout');
112
- }
113
- });
114
-
115
- return this;
116
- }
117
-
118
-
119
- jasmine.Ajax = {
120
-
121
- isInstalled: function() {
122
- return jasmine.Ajax.installed == true;
123
- },
124
-
125
- assertInstalled: function() {
126
- if (!jasmine.Ajax.isInstalled()) {
127
- throw new Error("Mock ajax is not installed, use jasmine.Ajax.useMock()")
128
- }
129
- },
130
-
131
- useMock: function() {
132
- if (!jasmine.Ajax.isInstalled()) {
133
- var spec = jasmine.getEnv().currentSpec;
134
- spec.after(jasmine.Ajax.uninstallMock);
135
-
136
- jasmine.Ajax.installMock();
137
- }
138
- },
139
-
140
- installMock: function() {
141
- if (typeof jQuery != 'undefined') {
142
- jasmine.Ajax.installJquery();
143
- } else if (typeof Prototype != 'undefined') {
144
- jasmine.Ajax.installPrototype();
145
- } else {
146
- throw new Error("jasmine.Ajax currently only supports jQuery and Prototype");
147
- }
148
- jasmine.Ajax.installed = true;
149
- },
150
-
151
- installJquery: function() {
152
- jasmine.Ajax.mode = 'jQuery';
153
- jasmine.Ajax.real = jQuery.ajaxSettings.xhr;
154
- jQuery.ajaxSettings.xhr = jasmine.Ajax.jQueryMock;
155
-
156
- },
157
-
158
- installPrototype: function() {
159
- jasmine.Ajax.mode = 'Prototype';
160
- jasmine.Ajax.real = Ajax.getTransport;
161
-
162
- Ajax.getTransport = jasmine.Ajax.prototypeMock;
163
- },
164
-
165
- uninstallMock: function() {
166
- jasmine.Ajax.assertInstalled();
167
- if (jasmine.Ajax.mode == 'jQuery') {
168
- jQuery.ajaxSettings.xhr = jasmine.Ajax.real;
169
- } else if (jasmine.Ajax.mode == 'Prototype') {
170
- Ajax.getTransport = jasmine.Ajax.real;
171
- }
172
- jasmine.Ajax.reset();
173
- },
174
-
175
- reset: function() {
176
- jasmine.Ajax.installed = false;
177
- jasmine.Ajax.mode = null;
178
- jasmine.Ajax.real = null;
179
- },
180
-
181
- jQueryMock: function() {
182
- var newXhr = new FakeXMLHttpRequest();
183
- ajaxRequests.push(newXhr);
184
- return newXhr;
185
- },
186
-
187
- prototypeMock: function() {
188
- return new FakeXMLHttpRequest();
189
- },
190
-
191
- installed: false,
192
- mode: null
193
- }
194
-
195
-
196
- // Jasmine-Ajax Glue code for Prototype.js
197
- if (typeof Prototype != 'undefined' && Ajax && Ajax.Request) {
198
- Ajax.Request.prototype.originalRequest = Ajax.Request.prototype.request;
199
- Ajax.Request.prototype.request = function(url) {
200
- this.originalRequest(url);
201
- ajaxRequests.push(this);
202
- };
203
-
204
- Ajax.Request.prototype.response = function(responseOptions) {
205
- return this.transport.response(responseOptions);
206
- };
207
- }
@@ -1,3 +0,0 @@
1
- /*
2
- *= require application
3
- * /
@@ -1,2 +0,0 @@
1
- //=require application
2
- //=require_tree ./
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Phrase do
4
- it "can be created with text" do
5
- p = Phrase.create!(:text => "hello there")
6
- end
7
- it "text must not be blank" do
8
- p = Phrase.new
9
- p.should_not be_valid
10
- end
11
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
- describe "/phrases" do
3
- it "routes to index" do
4
- { :get => '/phrases'}.should(
5
- route_to(
6
- :controller => "phrases",
7
- :action => "index"
8
- ))
9
-
10
-
11
- end
12
- end
@@ -1,7 +0,0 @@
1
- require 'spec_helper'
2
- describe '/' do
3
- it "routes to phrases index" do
4
- {:get => "/"}.should(route_to(:controller => 'phrases',
5
- :action => 'index'))
6
- end
7
- end
@@ -1,9 +0,0 @@
1
- require "spec_helper"
2
- describe "phrases/_phrase.html.erb" do
3
- it "displays" do
4
- a_phrase =Phrase.create!(:text => 'snuggly')
5
- render "phrases/phrase", :phrase => a_phrase
6
- rendered.should have_css('.phrase .text', :text => 'snuggly')
7
- end
8
- end
9
-
@@ -1,10 +0,0 @@
1
- require "spec_helper"
2
- describe "phrases/index.html.erb" do
3
- it "renders a phrase template for each phrase" do
4
- my_phrases = [Phrase.create!(:text => 'snuggly'),
5
- Phrase.create!(:text => 'bear')]
6
- assign(:phrases, my_phrases) # @phrases = my_phrases in view
7
- render
8
- view.should render_template(:partial => "_phrase", :count => 2)
9
- end
10
- end