mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-01 22:17:49 -05:00
* Add dep * Add tests around accessibility * Add examples in a few places * Try to fix screenshots * Remove redundant role * Adjust rules, colors, etc so tests pass * Update app/assets/stylesheets/overrides.scss * Wrap in label * Omit rule, which is failing with a false positive * Update index.haml * Update _blurb.html.haml
39 lines
1.1 KiB
Ruby
39 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe 'Commenting on a post' do
|
|
include_context 'signed in member'
|
|
let(:member) { create(:member) }
|
|
let(:post) { create(:post, author: member) }
|
|
|
|
before { visit new_comment_path post_id: post.id }
|
|
|
|
include_examples 'is accessible'
|
|
|
|
it "creating a comment" do
|
|
fill_in "comment_body", with: "This is a sample test for comment"
|
|
click_button "Post comment"
|
|
expect(page).to have_content "comment was successfully created."
|
|
expect(page).to have_content "Posted by"
|
|
page.percy_snapshot(page, name: 'Posting a comment')
|
|
end
|
|
|
|
context "editing a comment" do
|
|
let(:existing_comment) { create(:comment, post:, author: member) }
|
|
|
|
before do
|
|
visit edit_comment_path existing_comment
|
|
end
|
|
|
|
include_examples 'is accessible'
|
|
|
|
it "saving edit" do
|
|
fill_in "comment_body", with: "Testing edit for comment"
|
|
click_button "Post comment"
|
|
expect(page).to have_content "comment was successfully updated."
|
|
expect(page).to have_content "edited at"
|
|
end
|
|
end
|
|
end
|