|
|
@ -3,6 +3,7 @@ require "rails_helper" |
|
|
|
RSpec.describe "logs/edit.html.erb" do |
|
|
|
RSpec.describe "logs/edit.html.erb" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
assign(:log, log) |
|
|
|
assign(:log, log) |
|
|
|
|
|
|
|
sign_in create(:user, :support) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when log is in progress" do |
|
|
|
context "when log is in progress" do |
|
|
@ -15,6 +16,14 @@ RSpec.describe "logs/edit.html.erb" do |
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).not_to have_link(text: "Back to lettings logs", href: "/lettings-logs") |
|
|
|
expect(fragment).not_to have_link(text: "Back to lettings logs", href: "/lettings-logs") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has link 'Delete log'" do |
|
|
|
|
|
|
|
render |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fragment = Capybara::Node::Simple.new(rendered) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Delete log", href: "/lettings-logs/#{log.id}/delete-confirmation") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when log is completed" do |
|
|
|
context "when log is completed" do |
|
|
@ -28,6 +37,14 @@ RSpec.describe "logs/edit.html.erb" do |
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Back to lettings logs", href: "/lettings-logs") |
|
|
|
expect(fragment).to have_link(text: "Back to lettings logs", href: "/lettings-logs") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has link 'Delete log'" do |
|
|
|
|
|
|
|
render |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fragment = Capybara::Node::Simple.new(rendered) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Delete log", href: "/lettings-logs/#{log.id}/delete-confirmation") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when showing a sales log" do |
|
|
|
context "when showing a sales log" do |
|
|
@ -40,6 +57,14 @@ RSpec.describe "logs/edit.html.erb" do |
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Back to sales logs", href: "/sales-logs") |
|
|
|
expect(fragment).to have_link(text: "Back to sales logs", href: "/sales-logs") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has link 'Delete log'" do |
|
|
|
|
|
|
|
render |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fragment = Capybara::Node::Simple.new(rendered) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Delete log", href: "/sales-logs/#{log.id}/delete-confirmation") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when lettings log is bulk uploaded" do |
|
|
|
context "when lettings log is bulk uploaded" do |
|
|
@ -53,6 +78,14 @@ RSpec.describe "logs/edit.html.erb" do |
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Back to uploaded logs", href: "/lettings-logs/bulk-upload-results/#{bulk_upload.id}/resume") |
|
|
|
expect(fragment).to have_link(text: "Back to uploaded logs", href: "/lettings-logs/bulk-upload-results/#{bulk_upload.id}/resume") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has link 'Delete log'" do |
|
|
|
|
|
|
|
render |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fragment = Capybara::Node::Simple.new(rendered) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Delete log", href: "/lettings-logs/#{log.id}/delete-confirmation") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when sales log is bulk uploaded" do |
|
|
|
context "when sales log is bulk uploaded" do |
|
|
@ -66,6 +99,14 @@ RSpec.describe "logs/edit.html.erb" do |
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Back to uploaded logs", href: "/sales-logs/bulk-upload-results/#{bulk_upload.id}/resume") |
|
|
|
expect(fragment).to have_link(text: "Back to uploaded logs", href: "/sales-logs/bulk-upload-results/#{bulk_upload.id}/resume") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has link 'Delete log'" do |
|
|
|
|
|
|
|
render |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fragment = Capybara::Node::Simple.new(rendered) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(fragment).to have_link(text: "Delete log", href: "/sales-logs/#{log.id}/delete-confirmation") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|