Commit 5b859e58 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Add feature spec for real-time sidebar assignees

Also mounts ActionCable in Capybara's Puma server
parent ca6aa800
# frozen_string_literal: true # frozen_string_literal: true
Rails.application.configure do Rails.application.configure do
# Prevents the default engine from being mounted because # We only mount the ActionCable engine in tests where we run it in-app
# we're running ActionCable as a standalone server # For other environments, we run it on a standalone Puma server
config.action_cable.mount_path = nil config.action_cable.mount_path = Rails.env.test? ? '/-/cable' : nil
config.action_cable.url = Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, '/-/cable') config.action_cable.url = Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, '/-/cable')
config.action_cable.worker_pool_size = Gitlab.config.action_cable.worker_pool_size config.action_cable.worker_pool_size = Gitlab.config.action_cable.worker_pool_size
end end
# frozen_string_literal: true
require 'spec_helper'
describe 'Issues > Real-time sidebar', :js do
let_it_be(:project) { create(:project, :public) }
let_it_be(:issue) { create(:issue, project: project) }
let_it_be(:user) { create(:user) }
before_all do
project.add_developer(user)
end
it 'updates the assignee in real-time' do
Capybara::Session.new(:other_session)
using_session :other_session do
visit project_issue_path(project, issue)
expect(page.find('.assignee')).to have_content 'None'
end
gitlab_sign_in(user)
visit project_issue_path(project, issue)
expect(page.find('.assignee')).to have_content 'None'
click_button 'assign yourself'
using_session :other_session do
expect(page.find('.assignee')).to have_content user.name
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment