Welcome to mirror list, hosted at ThFree Co, Russian Federation.

user_toggles_subscription_spec.rb « issues « projects « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 117a614b98063481df6731d9fe870cf837b85f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require "spec_helper"

describe "User toggles subscription", :js do
  set(:project) { create(:project_empty_repo, :public) }
  set(:user) { create(:user) }
  set(:issue) { create(:issue, project: project, author: user) }

  before do
    project.add_developer(user)
    sign_in(user)

    visit(project_issue_path(project, issue))
  end

  it "unsibscribes from issue" do
    subscription_button = find(".js-issuable-subscribe-button")

    # Check we're subscribed.
    expect(subscription_button).to have_css("button.is-checked")

    # Toggle subscription.
    find(".js-issuable-subscribe-button button").click
    wait_for_requests

    # Check we're unsubscribed.
    expect(subscription_button).to have_css("button:not(.is-checked)")
  end
end