Skip to content

Commit

Permalink
Removes project_boards_serializer
Browse files Browse the repository at this point in the history
fix broken tests
  • Loading branch information
gabrielcicero45 committed Nov 1, 2023
1 parent 08ee606 commit 6cc2c77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
10 changes: 2 additions & 8 deletions app/controllers/beta/project_boards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,19 @@ def show
project_id: params[:id],
current_user: current_user,
current_flow: cookies[:current_flow],
projects_scope: policy_scope(Project)
projects_scope: policy_scope(Project),
)

@project = result.success.project
authorize @project, policy_class: Beta::ProjectPolicy

response = result.success.as_json(root: false)
render json: collapse_response_stories(response)
render json: response
end

private

def set_fluid_layout
@layout_settings[:fluid] = true
end

def collapse_response_stories(response)
stories = response['stories']
response['stories'] = ProjectBoardsSerializer.collapsed_stories(stories)
response
end
end
17 changes: 0 additions & 17 deletions app/serializers/project_boards_serializer.rb

This file was deleted.

5 changes: 3 additions & 2 deletions spec/operations/beta/project_board_operations/read_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
let(:user) { create(:user, :with_team) }

context 'when the project exists' do
let(:story_operations_read_all_instance) { instance_double(StoryOperations::ReadAll, call: Dry::Monads::Success({ active_stories: stories, past_iterations: 'Past Iterations' })) }
let(:story_operations_read_all_instance) { instance_double(StoryOperations::ReadAll, call: Dry::Monads::Success({ active_stories: stories })) }

before do
allow(StoryOperations::ReadAll).to receive(:new).and_return(story_operations_read_all_instance)
allow_any_instance_of(Iterations::ProjectIterations).to receive(:past_iterations).and_return("Past Iterations")
end

it 'returns success' do
Expand Down Expand Up @@ -46,7 +47,7 @@
end

it 'returns with stories' do
expect(subject.call.success.stories).to eq(stories)
expect(subject.call.success.stories).to match_array(stories)
end

it 'returns with past_iterations' do
Expand Down

0 comments on commit 6cc2c77

Please sign in to comment.