spec/lita/handlers/youtrack_spec.rb in lita-youtrack-0.1.0 vs spec/lita/handlers/youtrack_spec.rb in lita-youtrack-0.1.1
- old
+ new
@@ -12,12 +12,14 @@
let(:bugs_parking_output) { [File.read("spec/fixtures/bugs_parking_output.txt")] }
let(:no_bugs_input) { File.read("spec/fixtures/no_bugs_input.xml") }
let(:no_bugs_output) { [File.read("spec/fixtures/no_bugs_output.txt")] }
let(:projects_input) { File.read("spec/fixtures/projects_input.xml") }
let(:projects_output) { [File.read("spec/fixtures/projects_output.txt")] }
- let(:project_membr_input) { File.read("spec/fixtures/project_MEMBR_input.xml") }
- let(:project_membr_output) { [File.read("spec/fixtures/project_MEMBR_output.txt")] }
+ let(:project_rsa_input) { File.read("spec/fixtures/project_RSA_input.xml") }
+ let(:project_rsa_output) { [File.read("spec/fixtures/project_RSA_output.txt")] }
+ let(:project_rsa_all_input) { File.read("spec/fixtures/RSA_all_input.xml") }
+ let(:project_rsa_all_output) { [File.read("spec/fixtures/RSA_all_output.txt")] }
let(:cookie) { [File.read("spec/fixtures/cookie.txt")] }
it 'tells lita to display the important bug list' do
allow_any_instance_of(Lita::Handlers::Youtrack).to receive(:call_http) { bugs_input }
send_command("bugs")
@@ -44,20 +46,27 @@
send_command("projects")
expect(replies).to eq(projects_output)
end
- it 'tells lita to display specific existing project (MEMBR)' do
- allow_any_instance_of(Lita::Handlers::Youtrack).to receive(:call_http) { project_membr_input }
- send_command("project MEMBR")
+ it 'tells lita to display incomplete issues in specific project (RSA)' do
+ allow_any_instance_of(Lita::Handlers::Youtrack).to receive(:call_http) { project_rsa_input }
+ send_command("project RSA")
- expect(replies).to eq(project_membr_output)
+ expect(replies).to eq(project_rsa_output)
end
+ it 'tells lita to display all issues in specific project (RSA)' do
+ allow_any_instance_of(Lita::Handlers::Youtrack).to receive(:call_http) { project_rsa_all_input }
+ send_command("project RSA all")
+
+ expect(replies).to eq(project_rsa_all_output)
+ end
+
it 'tells lita to display warning for non-existant project (asdf)' do
allow_any_instance_of(Lita::Handlers::Youtrack).to receive(:call_http) { "" }
send_command("project ASDF")
- expect(replies).to include("Project not found - type 'lita projects' for list")
+ expect(replies).to include("Either project doesn't exist, or it has no issues - type 'lita projects' for list\nShowing only incomplete issues, add an 'all' to see all issues\n")
end
end