|
104 | 104 | end |
105 | 105 | end |
106 | 106 |
|
107 | | - describe "PATCH #update" do |
108 | | - let(:organization) { create(:organization, name: "Original Name") } |
109 | | - subject do |
110 | | - patch admin_organization_path(id: organization.id, organization: { name: updated_name }) |
111 | | - end |
112 | | - |
113 | | - context "with a valid update" do |
114 | | - let(:updated_name) { "Updated Name" } |
115 | | - let(:redirect_status) { 302 } |
116 | | - |
117 | | - it "redirects to #index" do |
118 | | - expect(subject).to be(redirect_status) |
119 | | - expect(subject).to redirect_to(admin_organizations_path) |
120 | | - end |
121 | | - end |
122 | | - |
123 | | - context "with an invalid update" do |
124 | | - let(:updated_name) { nil } |
125 | | - let(:successful) { 200 } |
126 | | - |
127 | | - subject do |
128 | | - patch admin_organization_path(id: organization.id, organization: { name: updated_name }) |
129 | | - end |
130 | | - |
131 | | - it "returns http success" do |
132 | | - expect(subject).to be(successful) |
133 | | - end |
134 | | - |
135 | | - it "redirects to #edit with an error message" do |
136 | | - expect(subject).to render_template("edit") |
137 | | - expect(flash[:error]).to be_present |
138 | | - end |
139 | | - end |
140 | | - end |
141 | | - |
142 | 107 | describe "DELETE #destroy" do |
143 | 108 | let(:organization) { create(:organization) } |
144 | 109 |
|
|
150 | 115 | end |
151 | 116 | end |
152 | 117 |
|
153 | | - describe "GET #edit" do |
154 | | - let!(:organization) { create(:organization) } |
155 | | - |
156 | | - it "returns http success" do |
157 | | - get edit_admin_organization_path({ id: organization.id }) |
158 | | - expect(response).to be_successful |
159 | | - end |
160 | | - end |
161 | | - |
162 | 118 | describe "GET #show" do |
163 | 119 | let!(:organization) { create(:organization) } |
164 | 120 |
|
|
194 | 150 | end |
195 | 151 | end |
196 | 152 |
|
197 | | - describe "PUT #update" do |
198 | | - it "redirect" do |
199 | | - put admin_organization_path({ id: organization.id, organization: { name: "Foo" } }) |
200 | | - expect(response).to be_redirect |
201 | | - end |
202 | | - end |
203 | | - |
204 | 153 | describe "DELETE #destroy" do |
205 | 154 | it "redirects" do |
206 | 155 | delete admin_organization_path({ id: organization.id }) |
|
234 | 183 | expect(response).to be_redirect |
235 | 184 | end |
236 | 185 | end |
237 | | - |
238 | | - describe "GET #edit" do |
239 | | - it "redirects" do |
240 | | - get edit_admin_organization_path({ id: organization.id }) |
241 | | - expect(response).to be_redirect |
242 | | - end |
243 | | - end |
244 | | - |
245 | | - describe "PUT #update" do |
246 | | - it "redirects" do |
247 | | - put admin_organization_path({ id: organization.id, organization: { name: "Foo" } }) |
248 | | - expect(response).to be_redirect |
249 | | - end |
250 | | - end |
251 | 186 | end |
252 | 187 | end |
0 commit comments