Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ class User implements UserDetails {

@Override
Collection<? extends GrantedAuthority> getAuthorities() {
roles.split('').collect { new SimpleGrantedAuthority(it) }
if (!roles) {
return Collections.emptyList()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just '[]' since this is groovy?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just '[]' since this is groovy?

}
roles
.split(',')
.collect { it.trim() }
.findAll { it }
.collect { new SimpleGrantedAuthority(it) }
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import grails.testing.mixin.integration.Integration
@Integration
class UserCommunityControllerSpec extends ContainerGebSpec {

void setup() {
private void loginAsTestUser() {
to(LoginPage).login()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the http session be different between setup and the one test? @matrei any idea?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdaugherty No, I would think it should work to login in void setup().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesfredley I don't think this PR is actually fixing this issue.

}

Expand All @@ -42,9 +42,10 @@ class UserCommunityControllerSpec extends ContainerGebSpec {

void "User list"() {
when:
loginAsTestUser()
def page = to(CommunityUserListPage)

then:
!page.scaffoldTable
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import grails.testing.mixin.integration.Integration
@Integration
class UserControllerSpec extends ContainerGebSpec {

void setup() {
private void loginAsTestUser() {
to(LoginPage).login()
}

Expand All @@ -42,9 +42,10 @@ class UserControllerSpec extends ContainerGebSpec {

void "User list"() {
when:
loginAsTestUser()
to(UserListPage)

then:
$('table.scaffold')
}
}
}
Loading