Use a block and move setup to example directly

This commit is contained in:
Lin Jen-Shin 2019-02-14 22:57:09 +08:00
parent 50491d3241
commit f80f6bbcdc
2 changed files with 3 additions and 5 deletions

View File

@ -19,7 +19,7 @@ module Resolvers
args[:iids] ||= [args[:iid]].compact
args[:iids].map(&method(:batch_load))
args[:iids].map { |iid| batch_load(iid) }
.select(&:itself) # .compact doesn't work on BatchLoader
end

View File

@ -75,11 +75,9 @@ describe 'getting an issue list for a project' do
end
context 'when the user can see confidential issues' do
before do
project.add_developer(current_user)
end
it 'returns issues with confidential issues' do
project.add_developer(current_user)
post_graphql(query, current_user: current_user)
expect(issues_data.size).to eq(3)