Skip to content

Commit bd79708

Browse files
authored
Merge pull request #137 from carryall/release/2.8.0
Release 2.8.0
2 parents 666e8a4 + 11cf53c commit bd79708

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+532
-163
lines changed

constants/result.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package constants
2+
3+
const (
4+
ResultNotFound = "Can not find result with the given ID"
5+
)

files/sample.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
keyword1
2+
keyword2

helpers/assets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package helpers
33
import "html/template"
44

55
func AssetsCSS(path string) template.HTML {
6-
linkHTML := `<link href="static/stylesheets/` + path + `" rel="stylesheet" type="text/css" />`
6+
linkHTML := `<link href="../../static/stylesheets/` + path + `" rel="stylesheet" type="text/css" />`
77

88
return template.HTML(linkHTML)
99
}

helpers/assets_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var _ = Describe("Assets", func() {
1313
It("returns a html string", func() {
1414
htmlStr := helpers.AssetsCSS("file_name")
1515

16-
Expect(string(htmlStr)).To(Equal(`<link href="static/stylesheets/file_name" rel="stylesheet" type="text/css" />`))
16+
Expect(string(htmlStr)).To(Equal(`<link href="../../static/stylesheets/file_name" rel="stylesheet" type="text/css" />`))
1717
})
1818
})
1919
})

lib/api/v1/controllers/authentication.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"go-google-scraper-challenge/errors"
88
. "go-google-scraper-challenge/helpers"
99
. "go-google-scraper-challenge/helpers/api"
10-
"go-google-scraper-challenge/lib/api/v1/forms"
10+
apiforms "go-google-scraper-challenge/lib/api/v1/forms"
1111
"go-google-scraper-challenge/lib/api/v1/serializers"
1212
"go-google-scraper-challenge/lib/services/oauth"
1313

@@ -20,7 +20,7 @@ type AuthenticationController struct {
2020
}
2121

2222
func (c *AuthenticationController) Login(ctx *gin.Context) {
23-
authenticationForm := &forms.AuthenticationForm{}
23+
authenticationForm := &apiforms.AuthenticationForm{}
2424

2525
err := ctx.ShouldBindWith(authenticationForm, binding.Form)
2626
if err != nil {

lib/api/v1/controllers/results.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66

77
"go-google-scraper-challenge/errors"
88
. "go-google-scraper-challenge/helpers/api"
9-
"go-google-scraper-challenge/lib/api/v1/forms"
109
"go-google-scraper-challenge/lib/api/v1/serializers"
10+
"go-google-scraper-challenge/lib/forms"
1111
"go-google-scraper-challenge/lib/models"
1212

1313
"github.com/gin-gonic/gin"

lib/api/v1/controllers/users.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"go-google-scraper-challenge/errors"
99
. "go-google-scraper-challenge/helpers/api"
10-
"go-google-scraper-challenge/lib/api/v1/forms"
10+
apiforms "go-google-scraper-challenge/lib/api/v1/forms"
1111
"go-google-scraper-challenge/lib/api/v1/serializers"
1212
"go-google-scraper-challenge/lib/models"
1313
"go-google-scraper-challenge/lib/services/oauth"
@@ -21,7 +21,7 @@ type UsersController struct {
2121
}
2222

2323
func (c *UsersController) Register(ctx *gin.Context) {
24-
registrationForm := &forms.RegistrationForm{}
24+
registrationForm := &apiforms.RegistrationForm{}
2525

2626
err := ctx.ShouldBindWith(registrationForm, binding.Form)
2727
if err != nil {

lib/api/v1/forms/authentication.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package forms
1+
package apiforms
22

33
import (
44
"errors"

lib/api/v1/forms/authentication_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package forms_test
1+
package apiforms_test
22

33
import (
44
"go-google-scraper-challenge/constants"
5-
"go-google-scraper-challenge/lib/api/v1/forms"
5+
apiforms "go-google-scraper-challenge/lib/api/v1/forms"
66
. "go-google-scraper-challenge/test"
77

88
"github.com/bxcodec/faker/v3"
@@ -17,7 +17,7 @@ var _ = Describe("API Authentication Form", func() {
1717
authClient := FabricateAuthClient()
1818
password := faker.Password()
1919
user := FabricateUser(faker.Email(), password)
20-
form := forms.AuthenticationForm{
20+
form := apiforms.AuthenticationForm{
2121
ClientID: authClient.ClientID,
2222
ClientSecret: authClient.ClientSecret,
2323
Email: user.Email,
@@ -39,7 +39,7 @@ var _ = Describe("API Authentication Form", func() {
3939
authClient := FabricateAuthClient()
4040
password := faker.Password()
4141
user := FabricateUser(faker.Email(), password)
42-
form := forms.AuthenticationForm{
42+
form := apiforms.AuthenticationForm{
4343
ClientID: "",
4444
ClientSecret: authClient.ClientSecret,
4545
Email: user.Email,
@@ -59,7 +59,7 @@ var _ = Describe("API Authentication Form", func() {
5959
authClient := FabricateAuthClient()
6060
password := faker.Password()
6161
user := FabricateUser(faker.Email(), password)
62-
form := forms.AuthenticationForm{
62+
form := apiforms.AuthenticationForm{
6363
ClientID: authClient.ClientID,
6464
ClientSecret: "",
6565
Email: user.Email,
@@ -79,7 +79,7 @@ var _ = Describe("API Authentication Form", func() {
7979
authClient := FabricateAuthClient()
8080
password := faker.Password()
8181
user := FabricateUser(faker.Email(), password)
82-
form := forms.AuthenticationForm{
82+
form := apiforms.AuthenticationForm{
8383
ClientID: authClient.ClientID,
8484
ClientSecret: authClient.ClientSecret,
8585
Email: user.Email,
@@ -100,7 +100,7 @@ var _ = Describe("API Authentication Form", func() {
100100
authClient := FabricateAuthClient()
101101
password := faker.Password()
102102
FabricateUser(faker.Email(), password)
103-
form := forms.AuthenticationForm{
103+
form := apiforms.AuthenticationForm{
104104
ClientID: authClient.ClientID,
105105
ClientSecret: authClient.ClientSecret,
106106
Email: "",
@@ -120,7 +120,7 @@ var _ = Describe("API Authentication Form", func() {
120120
authClient := FabricateAuthClient()
121121
password := faker.Password()
122122
FabricateUser(faker.Email(), password)
123-
form := forms.AuthenticationForm{
123+
form := apiforms.AuthenticationForm{
124124
ClientID: authClient.ClientID,
125125
ClientSecret: authClient.ClientSecret,
126126
Email: "invalid",
@@ -141,7 +141,7 @@ var _ = Describe("API Authentication Form", func() {
141141
It("returns an INVALID password error", func() {
142142
authClient := FabricateAuthClient()
143143
user := FabricateUser(faker.Email(), faker.Password())
144-
form := forms.AuthenticationForm{
144+
form := apiforms.AuthenticationForm{
145145
ClientID: authClient.ClientID,
146146
ClientSecret: authClient.ClientSecret,
147147
Email: user.Email,
@@ -164,7 +164,7 @@ var _ = Describe("API Authentication Form", func() {
164164
It("returns a user does not exist error", func() {
165165
authClient := FabricateAuthClient()
166166
user := FabricateUser(faker.Email(), faker.Password())
167-
form := forms.AuthenticationForm{
167+
form := apiforms.AuthenticationForm{
168168
ClientID: authClient.ClientID,
169169
ClientSecret: authClient.ClientSecret,
170170
Email: user.Email,
@@ -181,7 +181,7 @@ var _ = Describe("API Authentication Form", func() {
181181
Context("given email that does NOT belongs to any user", func() {
182182
It("returns a user does not exist error", func() {
183183
authClient := FabricateAuthClient()
184-
form := forms.AuthenticationForm{
184+
form := apiforms.AuthenticationForm{
185185
ClientID: authClient.ClientID,
186186
ClientSecret: authClient.ClientSecret,
187187
Email: faker.Email(),

lib/api/v1/forms/forms_suite_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package forms_test
1+
package apiforms_test
22

33
import (
44
"testing"
@@ -9,9 +9,9 @@ import (
99
. "github.com/onsi/gomega"
1010
)
1111

12-
func TestForms(t *testing.T) {
12+
func TestAPIForms(t *testing.T) {
1313
RegisterFailHandler(Fail)
14-
RunSpecs(t, "Forms Suite")
14+
RunSpecs(t, "API Forms Suite")
1515
}
1616

1717
var _ = BeforeSuite(func() {

0 commit comments

Comments
 (0)