diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-05-19 01:19:25 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-05-19 01:25:45 +0300 |
commit | c337e748d385fea5c768a8e7de55975dca7fa484 (patch) | |
tree | f9646fbb68614b633964bc43d725296b61047fec /spec/lib/gitlab/email | |
parent | 3f4a6412dcc35c182d993cd1350459e8a4a1b8d1 (diff) |
so we use separate classes to handle different tasks
Diffstat (limited to 'spec/lib/gitlab/email')
-rw-r--r-- | spec/lib/gitlab/email/receiver_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb index c0fc18a9f83..58c525f4048 100644 --- a/spec/lib/gitlab/email/receiver_spec.rb +++ b/spec/lib/gitlab/email/receiver_spec.rb @@ -34,7 +34,7 @@ describe Gitlab::Email::Receiver, lib: true do let(:email_raw) { fixture_file('emails/valid_reply.eml').gsub(reply_key, "") } it "raises a SentNotificationNotFoundError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::SentNotificationNotFoundError) + expect { receiver.execute }.to raise_error(Gitlab::Email::SentNotificationNotFoundError) end end @@ -42,7 +42,7 @@ describe Gitlab::Email::Receiver, lib: true do let(:email_raw) { fixture_file('emails/wrong_reply_key.eml') } it "raises a SentNotificationNotFoundError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::SentNotificationNotFoundError) + expect { receiver.execute }.to raise_error(Gitlab::Email::SentNotificationNotFoundError) end end @@ -50,7 +50,7 @@ describe Gitlab::Email::Receiver, lib: true do let(:email_raw) { "" } it "raises an EmptyEmailError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::EmptyEmailError) + expect { receiver.execute }.to raise_error(Gitlab::Email::EmptyEmailError) end end @@ -59,7 +59,7 @@ describe Gitlab::Email::Receiver, lib: true do let!(:email_raw) { fixture_file("emails/auto_reply.eml") } it "raises an AutoGeneratedEmailError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::AutoGeneratedEmailError) + expect { receiver.execute }.to raise_error(Gitlab::Email::AutoGeneratedEmailError) end end @@ -69,7 +69,7 @@ describe Gitlab::Email::Receiver, lib: true do end it "raises a UserNotFoundError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::UserNotFoundError) + expect { receiver.execute }.to raise_error(Gitlab::Email::UserNotFoundError) end end @@ -79,7 +79,7 @@ describe Gitlab::Email::Receiver, lib: true do end it "raises a UserBlockedError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::UserBlockedError) + expect { receiver.execute }.to raise_error(Gitlab::Email::UserBlockedError) end end @@ -89,7 +89,7 @@ describe Gitlab::Email::Receiver, lib: true do end it "raises a UserNotAuthorizedError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::UserNotAuthorizedError) + expect { receiver.execute }.to raise_error(Gitlab::Email::UserNotAuthorizedError) end end @@ -99,7 +99,7 @@ describe Gitlab::Email::Receiver, lib: true do end it "raises a NoteableNotFoundError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::NoteableNotFoundError) + expect { receiver.execute }.to raise_error(Gitlab::Email::NoteableNotFoundError) end end @@ -107,7 +107,7 @@ describe Gitlab::Email::Receiver, lib: true do let!(:email_raw) { fixture_file("emails/no_content_reply.eml") } it "raises an EmptyEmailError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::EmptyEmailError) + expect { receiver.execute }.to raise_error(Gitlab::Email::EmptyEmailError) end end @@ -117,7 +117,7 @@ describe Gitlab::Email::Receiver, lib: true do end it "raises an InvalidNoteError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::InvalidNoteError) + expect { receiver.execute }.to raise_error(Gitlab::Email::InvalidNoteError) end end @@ -220,7 +220,7 @@ describe Gitlab::Email::Receiver, lib: true do end it "raises an InvalidIssueError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::InvalidIssueError) + expect { receiver.execute }.to raise_error(Gitlab::Email::InvalidIssueError) end end @@ -228,7 +228,7 @@ describe Gitlab::Email::Receiver, lib: true do let!(:email_raw) { fixture_file("emails/wrong_authentication_token.eml") } it "raises an UserNotAuthorizedError" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::UserNotAuthorizedError) + expect { receiver.execute }.to raise_error(Gitlab::Email::UserNotAuthorizedError) end end @@ -236,7 +236,7 @@ describe Gitlab::Email::Receiver, lib: true do let(:project) { create(:project, :private, namespace: namespace) } it "raises a ProjectNotFound if the user is not a member" do - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::ProjectNotFound) + expect { receiver.execute }.to raise_error(Gitlab::Email::ProjectNotFound) end it "raises a UserNotAuthorizedError if the user has no sufficient permission" do @@ -245,7 +245,7 @@ describe Gitlab::Email::Receiver, lib: true do project.update(group: create(:group)) project.group.add_guest(user) - expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::UserNotAuthorizedError) + expect { receiver.execute }.to raise_error(Gitlab::Email::UserNotAuthorizedError) end end end |