-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PROBLEM-1079] fixing inner loop in actions_assignees (#158)
* [PROBLEM-1079] fixing inner loop in actions_assignees * Adding new unit test for action assignees and pr feedback
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package feed_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
"time" | ||
|
||
"github.com/SafetyCulture/iauditor-exporter/internal/app/feed" | ||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/SafetyCulture/iauditor-exporter/internal/app/api" | ||
) | ||
|
||
func TestActionAssigneeFeedExport_should_export_rows_to_sql_db(t *testing.T) { | ||
exporter, err := getInmemorySQLExporter("") | ||
assert.Nil(t, err) | ||
|
||
apiClient := api.GetTestClient() | ||
initMockFeedsSet1(apiClient.HTTPClient()) | ||
|
||
actionAssigneeFeed := feed.ActionAssigneeFeed{ | ||
ModifiedAfter: time.Now(), | ||
Incremental: true, | ||
} | ||
|
||
err = actionAssigneeFeed.Export(context.Background(), apiClient, exporter, "") | ||
assert.Nil(t, err) | ||
|
||
rows := []feed.ActionAssignee{} | ||
resp := exporter.DB.Table("action_assignees").Scan(&rows) | ||
assert.Nil(t, resp.Error) | ||
|
||
assert.Equal(t, 2, len(rows)) | ||
assert.Equal(t, "[email protected]", rows[0].AssigneeID) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters