responders 2.0.1 → 2.0.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/CHANGELOG.md +3 -3
- data/lib/generators/rails/templates/controller.rb +17 -15
- data/lib/responders/version.rb +1 -1
- metadata +3 -39
- data/test/action_controller/respond_with_test.rb +0 -715
- data/test/locales/en.yml +0 -28
- data/test/responders/collection_responder_test.rb +0 -82
- data/test/responders/controller_method_test.rb +0 -72
- data/test/responders/flash_responder_test.rb +0 -260
- data/test/responders/http_cache_responder_test.rb +0 -120
- data/test/test_helper.rb +0 -86
- data/test/views/addresses/create.js.erb +0 -1
- data/test/views/addresses/edit.html.erb +0 -1
- data/test/views/addresses/new.html.erb +0 -1
- data/test/views/locations/new.html.erb +0 -1
- data/test/views/respond_with/edit.html.erb +0 -1
- data/test/views/respond_with/new.html.erb +0 -1
- data/test/views/respond_with/respond_with_additional_params.html.erb +0 -0
- data/test/views/respond_with/using_invalid_resource_with_template.xml.erb +0 -1
- data/test/views/respond_with/using_options_with_template.xml.erb +0 -1
- data/test/views/respond_with/using_resource.js.erb +0 -1
- data/test/views/respond_with/using_resource_with_block.html.erb +0 -1
data/test/test_helper.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
require 'mocha/setup'
|
4
|
-
|
5
|
-
# Configure Rails
|
6
|
-
ENV["RAILS_ENV"] = "test"
|
7
|
-
|
8
|
-
require 'active_support'
|
9
|
-
require 'active_model'
|
10
|
-
require 'rails/engine'
|
11
|
-
require 'rails/railtie'
|
12
|
-
|
13
|
-
$:.unshift File.expand_path('../../lib', __FILE__)
|
14
|
-
require 'responders'
|
15
|
-
|
16
|
-
I18n.enforce_available_locales = true
|
17
|
-
I18n.load_path << File.expand_path('../locales/en.yml', __FILE__)
|
18
|
-
I18n.reload!
|
19
|
-
|
20
|
-
Responders::Routes = ActionDispatch::Routing::RouteSet.new
|
21
|
-
Responders::Routes.draw do
|
22
|
-
resources :news
|
23
|
-
get '/admin/:action', :controller => "admin/addresses"
|
24
|
-
get '/:controller(/:action(/:id))'
|
25
|
-
end
|
26
|
-
|
27
|
-
class ApplicationController < ActionController::Base
|
28
|
-
include Responders::Routes.url_helpers
|
29
|
-
|
30
|
-
self.view_paths = File.join(File.dirname(__FILE__), 'views')
|
31
|
-
respond_to :html, :xml
|
32
|
-
end
|
33
|
-
|
34
|
-
class ActiveSupport::TestCase
|
35
|
-
setup do
|
36
|
-
@routes = Responders::Routes
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
module ActionDispatch
|
41
|
-
class Flash
|
42
|
-
class FlashHash
|
43
|
-
def used_keys
|
44
|
-
# Rails 3 || Rails 4
|
45
|
-
@used || @discard
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class Model
|
52
|
-
include ActiveModel::Conversion
|
53
|
-
include ActiveModel::Validations
|
54
|
-
|
55
|
-
attr_accessor :persisted, :updated_at
|
56
|
-
alias :persisted? :persisted
|
57
|
-
|
58
|
-
def persisted?
|
59
|
-
@persisted
|
60
|
-
end
|
61
|
-
|
62
|
-
def to_xml(*args)
|
63
|
-
"<xml />"
|
64
|
-
end
|
65
|
-
|
66
|
-
def initialize(updated_at=nil)
|
67
|
-
@persisted = true
|
68
|
-
self.updated_at = updated_at
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
class Address < Model
|
73
|
-
end
|
74
|
-
|
75
|
-
class User < Model
|
76
|
-
end
|
77
|
-
|
78
|
-
class News < Model
|
79
|
-
end
|
80
|
-
|
81
|
-
module MyEngine
|
82
|
-
class Business < Rails::Engine
|
83
|
-
isolate_namespace MyEngine
|
84
|
-
extend ActiveModel::Naming
|
85
|
-
end
|
86
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
create.js.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
edit.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
new.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
new.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
Edit world!
|
@@ -1 +0,0 @@
|
|
1
|
-
New world!
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
<content>I should not be displayed</content>
|
@@ -1 +0,0 @@
|
|
1
|
-
<customer-name><%= @customer.name %></customer-name>
|
@@ -1 +0,0 @@
|
|
1
|
-
alert("Hi");
|
@@ -1 +0,0 @@
|
|
1
|
-
Hello world!
|