Files
nairobi/spec/system/admin/comments_spec.rb
Javi Martín 3da4ee00b8 Simplify tests requiring admin login
We were repeating the same code over and over (with a few variants) to
setup tests which require an administrator. We can use a tag and
simplify the code.
2020-12-02 15:33:19 +01:00

13 lines
281 B
Ruby

require "rails_helper"
describe "Admin comments", :admin do
scenario "Index" do
create(:comment, body: "Everything is awesome")
visit admin_root_path
within("#side_menu") { click_link "Comments" }
expect(page).to have_content "Everything is awesome"
end
end