|
53 | 53 | expect(row.dig(:attributes, :status)).to eq(sync_run.status)
|
54 | 54 | expect(response_hash.dig(:links, :first)).to include("http://www.example.com/api/v1/syncs/#{sync.id}/sync_runs?page=1")
|
55 | 55 | end
|
| 56 | + |
| 57 | + audit_log = AuditLog.last |
| 58 | + expect(audit_log).not_to be_nil |
| 59 | + expect(audit_log.user_id).to eq(user.id) |
| 60 | + expect(audit_log.action).to eq("index") |
| 61 | + expect(audit_log.resource_type).to eq("Sync_run") |
| 62 | + expect(audit_log.resource_id).to eq(nil) |
| 63 | + expect(audit_log.resource).to eq(nil) |
| 64 | + expect(audit_log.workspace_id).to eq(workspace.id) |
| 65 | + expect(audit_log.created_at).not_to be_nil |
| 66 | + expect(audit_log.updated_at).not_to be_nil |
56 | 67 | end
|
57 | 68 |
|
58 | 69 | it "returns success and fetch sync for member_role" do
|
|
72 | 83 | expect(row.dig(:attributes, :status)).to eq(sync_run.status)
|
73 | 84 | expect(response_hash.dig(:links, :first)).to include("http://www.example.com/api/v1/syncs/#{sync.id}/sync_runs?page=1")
|
74 | 85 | end
|
| 86 | + |
| 87 | + audit_log = AuditLog.last |
| 88 | + expect(audit_log).not_to be_nil |
| 89 | + expect(audit_log.user_id).to eq(user.id) |
| 90 | + expect(audit_log.action).to eq("index") |
| 91 | + expect(audit_log.resource_type).to eq("Sync_run") |
| 92 | + expect(audit_log.resource_id).to eq(nil) |
| 93 | + expect(audit_log.resource).to eq(nil) |
| 94 | + expect(audit_log.workspace_id).to eq(workspace.id) |
| 95 | + expect(audit_log.created_at).not_to be_nil |
| 96 | + expect(audit_log.updated_at).not_to be_nil |
75 | 97 | end
|
76 | 98 |
|
77 | 99 | it "returns success and fetch sync for viewer_role" do
|
|
91 | 113 | expect(row.dig(:attributes, :status)).to eq(sync_run.status)
|
92 | 114 | expect(response_hash.dig(:links, :first)).to include("http://www.example.com/api/v1/syncs/#{sync.id}/sync_runs?page=1")
|
93 | 115 | end
|
| 116 | + |
| 117 | + audit_log = AuditLog.last |
| 118 | + expect(audit_log).not_to be_nil |
| 119 | + expect(audit_log.user_id).to eq(user.id) |
| 120 | + expect(audit_log.action).to eq("index") |
| 121 | + expect(audit_log.resource_type).to eq("Sync_run") |
| 122 | + expect(audit_log.resource_id).to eq(nil) |
| 123 | + expect(audit_log.resource).to eq(nil) |
| 124 | + expect(audit_log.workspace_id).to eq(workspace.id) |
| 125 | + expect(audit_log.created_at).not_to be_nil |
| 126 | + expect(audit_log.updated_at).not_to be_nil |
94 | 127 | end
|
95 | 128 | end
|
96 | 129 |
|
|
139 | 172 | expect(response_hash.dig(:data, :attributes, :successful_rows)).to eq(sync_runs.first.successful_rows)
|
140 | 173 | expect(response_hash.dig(:data, :attributes, :failed_rows)).to eq(sync_runs.first.failed_rows)
|
141 | 174 | expect(response_hash.dig(:data, :attributes, :status)).to eq(sync_runs.first.status)
|
| 175 | + |
| 176 | + audit_log = AuditLog.last |
| 177 | + expect(audit_log).not_to be_nil |
| 178 | + expect(audit_log.user_id).to eq(user.id) |
| 179 | + expect(audit_log.action).to eq("show") |
| 180 | + expect(audit_log.resource_type).to eq("Sync_run") |
| 181 | + expect(audit_log.resource_id).to eq(sync_runs.first.id) |
| 182 | + expect(audit_log.resource).to eq(nil) |
| 183 | + expect(audit_log.workspace_id).to eq(workspace.id) |
| 184 | + expect(audit_log.created_at).not_to be_nil |
| 185 | + expect(audit_log.updated_at).not_to be_nil |
142 | 186 | end
|
143 | 187 |
|
144 | 188 | it "returns success and fetch sync for " do
|
|
153 | 197 | expect(response_hash.dig(:data, :attributes, :successful_rows)).to eq(sync_runs.first.successful_rows)
|
154 | 198 | expect(response_hash.dig(:data, :attributes, :failed_rows)).to eq(sync_runs.first.failed_rows)
|
155 | 199 | expect(response_hash.dig(:data, :attributes, :status)).to eq(sync_runs.first.status)
|
| 200 | + |
| 201 | + audit_log = AuditLog.last |
| 202 | + expect(audit_log).not_to be_nil |
| 203 | + expect(audit_log.user_id).to eq(user.id) |
| 204 | + expect(audit_log.action).to eq("show") |
| 205 | + expect(audit_log.resource_type).to eq("Sync_run") |
| 206 | + expect(audit_log.resource_id).to eq(sync_runs.first.id) |
| 207 | + expect(audit_log.resource).to eq(nil) |
| 208 | + expect(audit_log.workspace_id).to eq(workspace.id) |
| 209 | + expect(audit_log.created_at).not_to be_nil |
| 210 | + expect(audit_log.updated_at).not_to be_nil |
156 | 211 | end
|
157 | 212 |
|
158 | 213 | it "returns success and fetch sync " do
|
|
166 | 221 | expect(response_hash.dig(:data, :attributes, :successful_rows)).to eq(sync_runs.first.successful_rows)
|
167 | 222 | expect(response_hash.dig(:data, :attributes, :failed_rows)).to eq(sync_runs.first.failed_rows)
|
168 | 223 | expect(response_hash.dig(:data, :attributes, :status)).to eq(sync_runs.first.status)
|
| 224 | + |
| 225 | + audit_log = AuditLog.last |
| 226 | + expect(audit_log).not_to be_nil |
| 227 | + expect(audit_log.user_id).to eq(user.id) |
| 228 | + expect(audit_log.action).to eq("show") |
| 229 | + expect(audit_log.resource_type).to eq("Sync_run") |
| 230 | + expect(audit_log.resource_id).to eq(sync_runs.first.id) |
| 231 | + expect(audit_log.resource).to eq(nil) |
| 232 | + expect(audit_log.workspace_id).to eq(workspace.id) |
| 233 | + expect(audit_log.created_at).not_to be_nil |
| 234 | + expect(audit_log.updated_at).not_to be_nil |
169 | 235 | end
|
170 | 236 | end
|
171 | 237 |
|
|
0 commit comments