diff --git a/tests/admin_app_tests/endpoint_tests/images_test.go b/tests/admin_app_tests/endpoint_tests/images_test.go index c1293c6..6f380a9 100644 --- a/tests/admin_app_tests/endpoint_tests/images_test.go +++ b/tests/admin_app_tests/endpoint_tests/images_test.go @@ -19,6 +19,7 @@ import ( "github.com/matheusgomes28/urchin/tests/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + lua "github.com/yuin/gopher-lua" ) type imageResponse struct { @@ -32,7 +33,7 @@ func TestPostImage(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) w := httptest.NewRecorder() pr, pw := io.Pipe() @@ -68,7 +69,7 @@ func TestPostImageNotAnImageFile(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) w := httptest.NewRecorder() pr, pw := io.Pipe() @@ -99,7 +100,7 @@ func TestPostImageWrongFileContentType(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) w := httptest.NewRecorder() pr, pw := io.Pipe() @@ -132,7 +133,7 @@ func TestPostImageFailedToCreateDatabaseEntry(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) w := httptest.NewRecorder() pr, pw := io.Pipe() @@ -173,7 +174,7 @@ func TestGetImage(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) post_recorder := httptest.NewRecorder() pr, pw := io.Pipe() @@ -220,7 +221,7 @@ func TestGetImageNoDatabaseEntry(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) get_recorder := httptest.NewRecorder() uuid, _ := uuid.New() @@ -239,7 +240,7 @@ func TestGetImageNoImageFile(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) get_recorder := httptest.NewRecorder() uuid, _ := uuid.New() @@ -271,7 +272,7 @@ func TestDeleteImage(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) post_recorder := httptest.NewRecorder() pr, pw := io.Pipe() @@ -323,7 +324,7 @@ func TestDeleteImageNoDatabaseEntry(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) delete_recorder := httptest.NewRecorder() uuid, _ := uuid.New() @@ -350,7 +351,7 @@ func TestDeleteImageNoImageFile(t *testing.T) { }, } - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) delete_recorder := httptest.NewRecorder() uuid, _ := uuid.New() diff --git a/tests/admin_app_tests/endpoint_tests/posts_test.go b/tests/admin_app_tests/endpoint_tests/posts_test.go index 3eb316b..5dcc8a8 100644 --- a/tests/admin_app_tests/endpoint_tests/posts_test.go +++ b/tests/admin_app_tests/endpoint_tests/posts_test.go @@ -11,6 +11,7 @@ import ( "github.com/matheusgomes28/urchin/common" "github.com/matheusgomes28/urchin/tests/mocks" "github.com/stretchr/testify/assert" + lua "github.com/yuin/gopher-lua" ) type postRequest struct { @@ -36,7 +37,7 @@ var app_settings = common.AppSettings{ func TestIndexPing(t *testing.T) { database_mock := mocks.DatabaseMock{} - r := admin_app.SetupRoutes(app_settings, database_mock) + r := admin_app.SetupRoutes(app_settings, database_mock, make(map[string]*lua.LState)) w := httptest.NewRecorder() request := postRequest{ diff --git a/tests/system_tests/admin_app/endpoint_tests/image_test.go b/tests/system_tests/admin_app/endpoint_tests/image_test.go index c7636d6..0178ced 100644 --- a/tests/system_tests/admin_app/endpoint_tests/image_test.go +++ b/tests/system_tests/admin_app/endpoint_tests/image_test.go @@ -13,6 +13,7 @@ import ( _ "github.com/go-sql-driver/mysql" "github.com/stretchr/testify/require" + lua "github.com/yuin/gopher-lua" admin_app "github.com/matheusgomes28/urchin/admin-app" "github.com/matheusgomes28/urchin/tests/helpers" @@ -56,7 +57,7 @@ func TestImageUpload(t *testing.T) { // Execute multiform request post_recorder := httptest.NewRecorder() - r := admin_app.SetupRoutes(app_settings, database) + r := admin_app.SetupRoutes(app_settings, database, make(map[string]*lua.LState)) require.Nil(t, err) req, _ := http.NewRequest("POST", "/images", pr) diff --git a/tests/system_tests/admin_app/endpoint_tests/post_test.go b/tests/system_tests/admin_app/endpoint_tests/post_test.go index b5ae28e..ea2bdd3 100644 --- a/tests/system_tests/admin_app/endpoint_tests/post_test.go +++ b/tests/system_tests/admin_app/endpoint_tests/post_test.go @@ -11,6 +11,7 @@ import ( _ "github.com/go-sql-driver/mysql" "github.com/stretchr/testify/require" + lua "github.com/yuin/gopher-lua" admin_app "github.com/matheusgomes28/urchin/admin-app" "github.com/matheusgomes28/urchin/tests/helpers" @@ -42,7 +43,7 @@ func TestPostExists(t *testing.T) { } w := httptest.NewRecorder() - r := admin_app.SetupRoutes(app_settings, database) + r := admin_app.SetupRoutes(app_settings, database, make(map[string]*lua.LState)) request_bytes, err := json.Marshal(add_post_request) require.Nil(t, err) req, _ := http.NewRequest("POST", "/posts", bytes.NewBuffer(request_bytes))