|
28 | 28 |
|
29 | 29 | describe ".icons" do |
30 | 30 | it "puts create icon onto the icons" do |
31 | | - expect(described_class.icons[:create][0]).to eq "image/png" |
32 | | - expect( |
33 | | - described_class.icons[:create][1] |
34 | | - ).to eq ErrbitGithubPlugin.read_static_file("github_create.png") |
| 31 | + expect(described_class.icons[:create][0]).to eq("image/png") |
| 32 | + |
| 33 | + expect(described_class.icons[:create][1]) |
| 34 | + .to eq(ErrbitGithubPlugin.read_static_file("github_create.png")) |
35 | 35 | end |
36 | 36 |
|
37 | 37 | it "puts goto icon onto the icons" do |
38 | | - expect(described_class.icons[:goto][0]).to eq "image/png" |
39 | | - expect( |
40 | | - described_class.icons[:goto][1] |
41 | | - ).to eq ErrbitGithubPlugin.read_static_file("github_goto.png") |
| 38 | + expect(described_class.icons[:goto][0]).to eq("image/png") |
| 39 | + |
| 40 | + expect(described_class.icons[:goto][1]) |
| 41 | + .to eq(ErrbitGithubPlugin.read_static_file("github_goto.png")) |
42 | 42 | end |
43 | 43 |
|
44 | 44 | it "puts inactive icon onto the icons" do |
45 | | - expect(described_class.icons[:inactive][0]).to eq "image/png" |
46 | | - expect( |
47 | | - described_class.icons[:inactive][1] |
48 | | - ).to eq ErrbitGithubPlugin.read_static_file("github_inactive.png") |
| 45 | + expect(described_class.icons[:inactive][0]).to eq("image/png") |
| 46 | + |
| 47 | + expect(described_class.icons[:inactive][1]) |
| 48 | + .to eq(ErrbitGithubPlugin.read_static_file("github_inactive.png")) |
49 | 49 | end |
50 | 50 | end |
51 | 51 |
|
|
54 | 54 | describe "#configured?" do |
55 | 55 | context "with errors" do |
56 | 56 | let(:options) { {invalid_key: ""} } |
| 57 | + |
57 | 58 | it "return false" do |
58 | | - expect(tracker.configured?).to eq false |
| 59 | + expect(tracker.configured?).to eq(false) |
59 | 60 | end |
60 | 61 | end |
| 62 | + |
61 | 63 | context "without errors" do |
62 | 64 | let(:options) do |
63 | 65 | {username: "foo", password: "bar", github_repo: "user/repository"} |
64 | 66 | end |
| 67 | + |
65 | 68 | it "return true" do |
66 | | - expect(tracker.configured?).to eq true |
| 69 | + expect(tracker.configured?).to eq(true) |
67 | 70 | end |
68 | 71 | end |
69 | 72 | end |
70 | 73 |
|
71 | 74 | describe "#url" do |
72 | | - let(:options) { {github_repo: "repo"} } |
| 75 | + let(:options) { {github_repo: "user/repo"} } |
| 76 | + |
73 | 77 | it "returns issues url" do |
74 | | - expect(tracker.url).to eq "https://github.com/repo/issues" |
| 78 | + expect(tracker.url).to eq("https://github.com/user/repo/issues") |
75 | 79 | end |
76 | 80 | end |
77 | 81 |
|
|
87 | 91 | end |
88 | 92 | it { is_expected.not_to be_empty } |
89 | 93 | end |
| 94 | + |
90 | 95 | context "without github_repo" do |
91 | 96 | let(:options) do |
92 | 97 | {username: "foo", password: "bar", github_repo: ""} |
93 | 98 | end |
| 99 | + |
94 | 100 | it { is_expected.not_to be_empty } |
95 | 101 | end |
| 102 | + |
96 | 103 | context "with completed options" do |
97 | 104 | let(:options) do |
98 | 105 | {username: "foo", password: "bar", github_repo: "repo"} |
|
170 | 177 | end |
171 | 178 | end |
172 | 179 | end |
| 180 | + |
| 181 | + describe "#close_issue" do |
| 182 | + context "signed in with token" do |
| 183 | + let(:user) do |
| 184 | + { |
| 185 | + "github_login" => "bob", |
| 186 | + "github_oauth_token" => "valid_token" |
| 187 | + } |
| 188 | + end |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + end |
| 193 | + end |
173 | 194 | end |
0 commit comments