2020-05-06 15:09:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 18:09:01 +00:00
|
|
|
RSpec.describe 'Issues > Real-time sidebar', :js do
|
2020-05-06 15:09:42 +00:00
|
|
|
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
|
|
|
|
|
2021-04-13 09:11:10 +00:00
|
|
|
sign_in(user)
|
|
|
|
|
2020-05-06 15:09:42 +00:00
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
expect(page.find('.assignee')).to have_content 'None'
|
|
|
|
|
|
|
|
click_button 'assign yourself'
|
2021-04-13 09:11:10 +00:00
|
|
|
wait_for_requests
|
|
|
|
expect(page.find('.assignee')).to have_content user.name
|
2020-05-06 15:09:42 +00:00
|
|
|
|
|
|
|
using_session :other_session do
|
|
|
|
expect(page.find('.assignee')).to have_content user.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|