Skip to content

Commit 45a702c

Browse files
committed
Update tests
1 parent 3f2a695 commit 45a702c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/errbit_github_plugin/issue_tracker_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@
110110
end
111111
let(:fake_github_client) do
112112
double("Fake GitHub Client").tap do |github_client|
113-
github_client.stub(:create_issue).and_return(fake_issue)
113+
expect(github_client).to receive(:create_issue).and_return(fake_issue)
114114
end
115115
end
116116
let(:fake_issue) do
117117
double("Fake Issue").tap do |issue|
118-
issue.stub(:html_url).and_return("http://github.com/user/repos/issues/878")
118+
expect(issue).to receive(:html_url).and_return("http://github.com/user/repos/issues/878")
119119
end
120120
end
121121

@@ -127,7 +127,7 @@
127127
}
128128
end
129129
it "return issue url" do
130-
Octokit::Client.stub(:new).with(
130+
expect(Octokit::Client).to receive(:new).with(
131131
login: user["github_login"], access_token: user["github_oauth_token"]
132132
).and_return(fake_github_client)
133133
expect(subject).to eq fake_issue.html_url
@@ -137,7 +137,7 @@
137137
context "signed in with password" do
138138
let(:user) { {} }
139139
it "return issue url" do
140-
Octokit::Client.stub(:new).with(
140+
expect(Octokit::Client).to receive(:new).with(
141141
login: options["username"], password: options["password"]
142142
).and_return(fake_github_client)
143143
expect(subject).to eq fake_issue.html_url
@@ -149,7 +149,7 @@
149149
{"github_login" => "alice", "github_oauth_token" => "invalid_token"}
150150
end
151151
it "raise AuthenticationError" do
152-
Octokit::Client.stub(:new).with(
152+
expect(Octokit::Client).to receive(:new).with(
153153
login: user["github_login"], access_token: user["github_oauth_token"]
154154
).and_raise(Octokit::Unauthorized)
155155
expect { subject }.to raise_error

0 commit comments

Comments
 (0)