Skip to content

Commit 8719d42

Browse files
committed
Realiza ajustes pedidos na PR
1 parent 6af55eb commit 8719d42

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

config/routes.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
end
2121

2222
resources :reports, only: %i[index new create show] do
23-
post 'reject', on: :member
24-
post 'remove_content', on: :member
23+
post 'reject', 'remove_content', on: :member
2524
end
2625

2726
resources :users, only: [] do

spec/models/post_spec.rb

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
expect(post.valid?).to eq false
2222
end
2323
end
24+
25+
context 'data de publicação' do
26+
it 'não deve ser no passado' do
27+
user = create(:user)
28+
post = build(:post, user:, published_at: Time.zone.yesterday, status: :scheduled)
29+
30+
expect(post).not_to be_valid
31+
expect(post.errors[:published_at]).to include('não pode estar no passado')
32+
end
33+
end
2434
end
2535

2636
describe 'self.get_sample' do

spec/system/reports/user_report_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
visit post_path(post)
9898

9999
within '#comments' do
100-
expect(page.all('.reporting-button').size).to eq 2
100+
expect(page).to have_link('Denunciar').twice
101101
end
102102
expect(page.all('.comment').to_a.second).not_to have_link 'Denunciar'
103103
end

0 commit comments

Comments
 (0)