Closed wsurkamp closed 8 years ago
Second task - user list admin area
Atividade: 2 Área: Administrativa Tarefa: Criar página para listar todos os usuários cadastrados - Fazer os devidos testes
Atividade 2: Criada paginação Realizados os testes de integração da página de usuários
Correção DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
$ git diff test/integration/contests_test.rb
diff --git i/test/integration/contests_test.rb w/test/integration/contests_test.rb
index a6de18f..9b60bbf 100644
--- i/test/integration/contests_test.rb
+++ w/test/integration/contests_test.rb
@@ -18,7 +18,7 @@ class ContestsTest < ActionDispatch::IntegrationTest
assert_select "b", text: contest.title
end
- assert_select "a.thumbnail[href=?]", contest.id
+ assert_select "a.thumbnail[href=?]", contest_path(contest.id)
assert_select "a.thumbnail" do
assert_select "img[alt=?]", contest.title
@@ -32,7 +32,7 @@ class ContestsTest < ActionDispatch::IntegrationTest
assert_select "b", text: contest.closing_enrollment.strftime("%d/%m/%Y - %H:%M")
end
- assert_select "a.link_contest[href=?]", contest.id
+ assert_select ".link_contest a[href=?]", contest_path(contest.id)
end
end
test/integration/admin/list_user_test.rb:7:in`setup'
test/integration/admin/list_user_test.rb:7:in `setup'
Correção:
diff --git i/test/factories/users.rb w/test/factories/users.rb
index 788950e..37bdb3b 100644
--- i/test/factories/users.rb
+++ w/test/factories/users.rb
@@ -2,7 +2,7 @@
FactoryGirl.define do
factory :user do
name { "#{Faker::Name.first_name} #{Faker::Name.last_name}" }
- username { "#{Faker::Internet.user_name}_#{Random.new.rand(100)}" }
+ sequence(:username) { |n| Faker::Internet.user_name + "-#{n}" }
email { Faker::Internet.email }
password { 123123123 }
password_confirmation { 123123123 }
@@ -18,4 +18,4 @@ FactoryGirl.define do
factory :admin_user, parent: :user do
admin true
end
-end
\ No newline at end of file
+end
Área: Pública Tarefa: Visualização dos Concursos, /contests