/
navbar_spec.rb
48 lines (36 loc) · 1.26 KB
/
navbar_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
46
47
48
# encoding: UTF-8
require "spec_helper"
feature("Navbar") do
background do
# Setup BG Stuff
end
scenario("default models") do
visit ("/upmin")
within(".navbar ul.nav") do
expect(page).to(have_selector("li", text: "Customers"))
expect(page).to(have_selector("li", text: "Products"))
expect(page).to(have_selector("li", text: "Orders"))
expect(page).to(have_selector("li", text: "Product Orders"))
expect(page).to(have_selector("li", text: "Shipments"))
click_link("Customers")
end
expect(page).to(have_selector(".upmin-model", minimum: 10))
end
scenario("configged models") do
Upmin.configure do |config|
config.models = [:user, :product]
end
visit ("/upmin")
within(".navbar ul.nav") do
expect(page).to(have_selector("li", text: "Customers"))
expect(page).to(have_selector("li", text: "Products"))
expect(page).not_to(have_selector("li", text: "Orders"))
expect(page).not_to(have_selector("li", text: "Product Orders"))
expect(page).not_to(have_selector("li", text: "Shipments"))
click_link("Customers")
end
expect(page).to(have_selector(".upmin-model", minimum: 10))
# Reset this.
Upmin.configuration = Upmin::Configuration.new
end
end