natdeanlewissoftwire
2 years ago
9 changed files with 64 additions and 56 deletions
@ -1,53 +1,53 @@ |
|||||||
# require "rails_helper" |
require "rails_helper" |
||||||
# |
|
||||||
# RSpec.describe LogSummaryComponent, type: :component do |
RSpec.describe LogSummaryComponent, type: :component do |
||||||
# let(:support_user) { FactoryBot.create(:user, :support) } |
let(:support_user) { FactoryBot.create(:user, :support) } |
||||||
# let(:coordinator_user) { FactoryBot.create(:user) } |
let(:coordinator_user) { FactoryBot.create(:user) } |
||||||
# let(:propcode) { "P3647" } |
let(:propcode) { "P3647" } |
||||||
# let(:tenancycode) { "T62863" } |
let(:tenancycode) { "T62863" } |
||||||
# let(:lettings_log) { FactoryBot.create(:lettings_log, needstype: 1, tenancycode:, propcode:, startdate: Time.zone.today) } |
let(:lettings_log) { FactoryBot.create(:lettings_log, needstype: 1, tenancycode:, propcode:, startdate: Time.zone.today) } |
||||||
# let(:sales_log) { FactoryBot.create(:sales_log) } |
let(:sales_log) { FactoryBot.create(:sales_log) } |
||||||
# |
|
||||||
# context "when rendering lettings log for a support user" do |
context "when rendering lettings log for a support user" do |
||||||
# it "show the log summary with organisational relationships" do |
it "show the log summary with organisational relationships" do |
||||||
# result = render_inline(described_class.new(current_user: support_user, log: lettings_log)) |
result = render_inline(described_class.new(current_user: support_user, log: lettings_log)) |
||||||
# |
|
||||||
# expect(result).to have_link(lettings_log.id.to_s) |
expect(result).to have_link(lettings_log.id.to_s) |
||||||
# expect(result).to have_text(lettings_log.tenancycode) |
expect(result).to have_text(lettings_log.tenancycode) |
||||||
# expect(result).to have_text(lettings_log.propcode) |
expect(result).to have_text(lettings_log.propcode) |
||||||
# expect(result).to have_text("General needs") |
expect(result).to have_text("General needs") |
||||||
# expect(result).to have_text("Tenancy starts #{Time.zone.today.strftime('%e %B %Y')}") |
expect(result).to have_text("Tenancy starts #{Time.zone.today.strftime('%e %B %Y')}") |
||||||
# expect(result).to have_text("Created #{Time.zone.today.strftime('%e %B %Y')}") |
expect(result).to have_text("Created #{Time.zone.today.strftime('%e %B %Y')}") |
||||||
# expect(result).to have_text("by Danny Rojas") |
expect(result).to have_text("by Danny Rojas") |
||||||
# expect(result).to have_content("Owned by\n DLUHC") |
expect(result).to have_content("Owned by\n DLUHC") |
||||||
# expect(result).to have_content("Managed by\n DLUHC") |
expect(result).to have_content("Managed by\n DLUHC") |
||||||
# end |
end |
||||||
# end |
end |
||||||
# |
|
||||||
# context "when rendering lettings log for a data coordinator user" do |
context "when rendering lettings log for a data coordinator user" do |
||||||
# it "show the log summary" do |
it "show the log summary" do |
||||||
# result = render_inline(described_class.new(current_user: coordinator_user, log: lettings_log)) |
result = render_inline(described_class.new(current_user: coordinator_user, log: lettings_log)) |
||||||
# |
|
||||||
# expect(result).not_to have_content("Owned by") |
expect(result).not_to have_content("Owned by") |
||||||
# expect(result).not_to have_content("Managed by") |
expect(result).not_to have_content("Managed by") |
||||||
# end |
end |
||||||
# end |
end |
||||||
# |
|
||||||
# context "when rendering sales log for a support user" do |
context "when rendering sales log for a support user" do |
||||||
# it "show the log summary with organisational relationships" do |
it "show the log summary with organisational relationships" do |
||||||
# result = render_inline(described_class.new(current_user: support_user, log: sales_log)) |
result = render_inline(described_class.new(current_user: support_user, log: sales_log)) |
||||||
# |
|
||||||
# expect(result).to have_content("Owned by\n DLUHC") |
expect(result).to have_content("Owned by\n DLUHC") |
||||||
# expect(result).not_to have_content("Managed by") |
expect(result).not_to have_content("Managed by") |
||||||
# end |
end |
||||||
# end |
end |
||||||
# |
|
||||||
# context "when rendering sales log for a data coordinator user" do |
context "when rendering sales log for a data coordinator user" do |
||||||
# it "show the log summary" do |
it "show the log summary" do |
||||||
# result = render_inline(described_class.new(current_user: coordinator_user, log: sales_log)) |
result = render_inline(described_class.new(current_user: coordinator_user, log: sales_log)) |
||||||
# |
|
||||||
# expect(result).not_to have_content("Owned by") |
expect(result).not_to have_content("Owned by") |
||||||
# expect(result).not_to have_content("Managed by") |
expect(result).not_to have_content("Managed by") |
||||||
# end |
end |
||||||
# end |
end |
||||||
# end |
end |
||||||
|
Loading…
Reference in new issue