Files
grecia/spec/system/comments/budget_investments_spec.rb
taitus 793eaf4429 Remove unnecessary specs
The test "display administrator id on public views" is not correct. The valuation comments
are not display never on public views. If we reload this admin page we can see that the
description is render instead of administrator_id as we can see at the upper test:

```
scenario "display administrator description on admin views"
```

The deleted test was passed because there is an error at the moment to render the comments.
As we can see in the file ´app/views/comments/create.js.erb:10´ we try render comment
without valuation value:

```
App.Comments.add_comment(parent_id, "<li><%= j(render @comment) %></li>");
```
That it is necessary to render correctly the description or the id.

By other hand the test "public users not see admin description"  is already being checked
 in the 'system/comments_specs'. However, we are going to add a new expectation to
make sure that the admin description does not appear on the public pages.
2024-03-25 07:59:42 +01:00

35 lines
1.0 KiB
Ruby

require "rails_helper"
describe "Commenting Budget::Investments" do
let(:investment) { create(:budget_investment) }
describe "Administrators" do
context "comment as administrator" do
scenario "display administrator description on admin views" do
admin = create(:administrator, description: "user description")
login_as(admin.user)
visit admin_budget_budget_investment_path(investment.budget, investment)
fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-budget_investment_#{investment.id}"
click_button "Publish comment"
within "#comments" do
expect(page).to have_content "I am your Admin!"
end
refresh
within "#comments" do
expect(page).to have_content "I am your Admin!"
expect(page).to have_content "Administrator user description"
expect(page).to have_css "div.is-admin"
expect(page).to have_css "img.admin-avatar"
end
end
end
end
end