Skip to content

Commit

Permalink
Merge branch 'feature/SHIBUI-1281-QA' into feature/SHIBUI-1311-QA
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Smith committed Jul 18, 2019
2 parents 84a2c7a + 0feab88 commit 0831b37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class DevConfig {
roles.add(roleRepository.findByName('ROLE_ADMIN').get())
it
}, new User().with {
username = 'user'
password = '{noop}userpass'
username = 'nonadmin'
password = '{noop}nonadminpass'
firstName = 'Peter'
lastName = 'Vandelay'
emailAddress = 'peter@institution.edu'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.springframework.security.test.context.support.WithMockUser
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.result.MockMvcResultHandlers
import spock.lang.Ignore
import spock.lang.Specification

Expand Down Expand Up @@ -39,7 +40,7 @@ class UsersControllerIntegrationTests extends Specification {
def expectedJson = """
[
{
"modifiedBy" : anonymousUser,
"modifiedBy" : "anonymousUser",
"firstName" : "Joe",
"emailAddress" : "joe@institution.edu",
"role" : "ROLE_ADMIN",
Expand All @@ -48,7 +49,7 @@ class UsersControllerIntegrationTests extends Specification {
"lastName" : "Doe"
},
{
"modifiedBy" : anonymousUser,
"modifiedBy" : "anonymousUser",
"firstName" : "Peter",
"emailAddress" : "peter@institution.edu",
"role" : "ROLE_USER",
Expand All @@ -57,12 +58,21 @@ class UsersControllerIntegrationTests extends Specification {
"lastName" : "Vandelay"
},
{
"modifiedBy" : anonymousUser,
"modifiedBy" : "anonymousUser",
"firstName" : "Bad",
"emailAddress" : "badboy@institution.edu",
"role" : "ROLE_NONE",
"username" : "none",
"createdBy" : "anonymousUser",
"lastName" : "robot"
},
{
"modifiedBy" : "anonymousUser",
"firstName" : "Anon",
"emailAddress" : "anon@institution.edu",
"role" : "ROLE_ADMIN",
"username" : "anonymousUser",
"createdBy" : anonymousUser,
"createdBy" : "anonymousUser",
"lastName" : "Ymous"
}
]"""
Expand All @@ -75,7 +85,6 @@ class UsersControllerIntegrationTests extends Specification {
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(content().json(expectedJson, false))
}
@WithMockUser(value = "admin", roles = ["ADMIN"])
Expand Down

0 comments on commit 0831b37

Please sign in to comment.