/
navigation_spec.rb
45 lines (36 loc) · 1.04 KB
/
navigation_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require "rails_helper"
describe "navigation" do
it "has the link of back to application" do
visit admin_customers_path
navigation = find(".navigation")
expect(navigation).to have_link("Back to app")
end
it "highlights the link to the current page's resource type" do
visit admin_customers_path
active_link = find(".navigation__link--active")
expect(active_link.text).to eq "Customers"
end
it "displays translated name of model" do
translations = {
activerecord: {
models: {
customer: {
one: "User",
other: "Users",
},
},
},
}
with_translations(:en, translations) do
visit admin_customers_path
navigation = find(".navigation")
expect(navigation).to have_link("Users")
expect(page).to have_header("Users")
end
end
it "hides link to resources without index page" do
visit admin_customers_path
navigation = find(".navigation")
expect(navigation).not_to have_link("Product Meta Tags")
end
end