-
Notifications
You must be signed in to change notification settings - Fork 6
/
CHANGELOG
162 lines (109 loc) · 4.88 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
*0.2.0.pre.3*
* ISSUE: Whelp, needed to account for parent contexts being ActionController handlers. Fixed [jaknowlden]
*0.2.0.pre.2*
* When rails does redirects, it does not set action_controller.instance as you might expect; users should still have access to the response, though. This fixes that [jaknowlden]
*0.2.0.pre.1*
* Actually relying on riot-0.11.1. Whoops. [jaknowlden]
*0.2.0.pre*
* Using latest middleware construct from Riot 0.11.1. Also using eigen-class for hijacking local_run in the transactional, active record middleware. [jaknowlden]
* Bumping version up arbitrarily in order to move it past the previous 0.1.0 that we hijacked from @dasch :) [jaknowlden]
*0.0.10.pre.3*
* Renamed to riot-rails and am hoping @dasch is kind of enough to let me be an owner on the gem he originally pushed. The ol' bait and and switch. [jaknowlden]
* Added asserts_response context macro. You can also provide method names to be called against the response. [jaknowlden]
context FoosController do
setup { get "/foos" }
asserts_response.exists
asserts_response(:status).equals(200)
asserts_response(:body).matches(/Bar baz/)
end # FoosController
* Added GET support for ActionController testing, a la Rack testing methods. [jaknowlden]
context MyController do
setup { get "/my/dashboard", "foo" => "bar" }
end # MyController
* Redoing support for ActionController. Dropped everything started from scratch. Also, moved the context-helper stuff into Riot and called it ContextMiddleware. Reimplemented helpers as middleware here. [jaknowlden]
*0.0.9.pre*
* To accommodate the last change, added concept of context helpers. It's so simple you can define your own. [jaknowlden]
module RiotRails
register_context_helper do
def prepare_context(original_description, context)
# ...
context.<do-something-before-the-context-runs-if-you-want-to>
# ...
end
end
end
* Well. Aren't we special? We don't have include ActiveRecord or ActionController code if we don't want to. But if you do: [jaknowlden]
# teststrap.rb
require 'riot/activerecord' # implicit riot/rails require
require 'riot/actioncontroller' # also an implicit riot/rails require
* Added asserts_request and asserts_response context macros. They also take a possible method to call.
[jaknowlden]
rails_context UsersController do
hookup { get :show, :id => 1 }
asserts_response.kind_of(ActionController::TestResponse)
asserts_response(:body).kind_of(String)
asserts_request.kind_of(ActionController::TestRequest)
asserts_request(:cookies).kind_of(Hash)
end
* Controller assertions now no longer assume the actual value is a controller instance. Instead, the actual
value is something that should quack like a response. [jaknowlden]
* Added asserts_assigned context macro [jaknowlden]
rails_context UsersController do
hookup { get :show, :id => 1 }
asserts_assigned(:user).kind_of(User)
end
* rails_context now recognizes controllers [jaknowlden]
rails_context RoomsController do
hookup { get :index }
asserts_controller.reponse_status :ok
end
Plus, you can only use controlling within a rails_context now
rails_context "rooms" do
controlling :rooms
hookup { get :index }
asserts_controller.reponse_status :ok
end
* controlling now lets you pass a controller class reference in [jaknowlden]
rails_context "rooms" do
controlling RoomsController
end
* Reflection macros now test the options [emschwar]
rails_context Room do
asserts_topic.has_one :floor, :class_name => "Surface"
asserts_topic.has_many :walls, :join_table => "foos"
end
* Added the has_one reflection macro [emschwar]
rails_context Room do
asserts_topic.has_one :floor
end
* Added the attribute_is_invalid validation macro [jaknowlden]
rails_context Room do
hookup { topic.location = nil }
asserts_topic.attribute_is_invalid(:location, "can't be blank")
end
* Added validates_length_of assertion macro (minimalistic) [jaknowlden]
rails_context Room do
asserts_topic.validates_length_of :name, (2..36)
end
* Added transactional support to RailsContext. Disabled by default [jaknowlden]
rails_context Room do
set :transactional, true
end
* Added option enabling to RailsContext [jaknowlden]
rails_context Room do
set :this, "that"
end
* Added initial #rails_context. Assumes ActiveRecord class for now [jaknowlden]
class Room < ActiveRecord::Base
# ...
end
# TEST
rails_context Room do
asserts_topic.belongs_to(:house)
asserts_topic.validates_presence_of(:house_id)
end
* Added the #belongs_to ActiveRecord assertion macro [jaknowlden]
context "a Room" do
setup { Room.new }
asserts_topic.belongs_to(:house)
end