summaryrefslogtreecommitdiff
path: root/spec/models/concerns/subscribable_spec.rb
blob: 9ee60426a5da7ca559b9b934897025a3797cc09c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require "spec_helper"

describe Subscribable, "Subscribable" do
  let(:resource) { create(:issue) }
  let(:user) { create(:user) }

  describe "#subscribed?" do
    it do
      expect(resource.subscribed?(user)).to be_falsey
      resource.toggle_subscription(user)
      expect(resource.subscribed?(user)).to be_truthy
      resource.toggle_subscription(user)
      expect(resource.subscribed?(user)).to be_falsey
    end
  end
end