Last active
August 29, 2015 14:03
-
-
Save keating/50ba6138d3d1ac4334c8 to your computer and use it in GitHub Desktop.
Revisions
-
keating revised this gist
Jul 11, 2014 . 1 changed file with 49 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,32 +1,60 @@ describe "Admin see company list" do subject {page} describe "when there are no companies" do before do @admin = FactoryGirl.create(:developer_admin) admin_login(@admin) end it "displays an empty company list" do expect(page).to have_link("New Company") expect(page).to have_link("View History") within("table#companytable") do expect(page).to have_selector('thead') expect(page).to have_selector('tbody tr', maximum: 0) end within('table#companytable thead') do expect(page).to have_text "LOGO" expect(page).to have_text "NAME" expect(page).to have_text "USERNAME" expect(page).to have_text "ACTION" end end end describe "when there are companies" do before do @admin = FactoryGirl.create(:admin_with_companies_with_company_user) admin_login(@admin) end it "displays the company list" do expect(page).to have_link("View History") within("table#companytable") do expect(page).to have_selector('thead') expect(page).to have_selector('tbody tr', count: 2) end within("table#companytable tbody") do expect(page).to have_text('company_', count: 2) expect(page).to have_selector('a.btn', text: "Manage", count: 2) end end it "can see the company detail in a form", js: true do visit_company_show_page find("form#admin_form").should be_visible end it "can update the company information", js: true, driver: :poltergeist do visit_company_show_page find("form#admin_form").should be_visible fill_in "company_name", with: "AnotherName" fill_in "company_email", with: "[email protected]" fill_in "company_password", with: "password" find("input[value=Update]").click expect(Company.where(name: "AnotherName").first).not_to be_nil end end end -
keating renamed this gist
Jul 11, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
keating created this gist
Jul 11, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ describe "Dev Admin can download Visit's images" do before do set_up_complete_dataset_similar_to_seed admin_login(@admin) user_decides_to_manage_company(@company) end it "can download some of them", js: true do user_decides_to_export_visit_images within(:css, 'div#visit_export') do expect(page).to have_css('#download_selection') end check('is_tagged', match: :first) zip_file_with_selected_image_should_exist end it "can download all of them",js: true do user_decides_to_export_visit_images within(:css, 'div#visit_export') do expect(page).to have_css('#download_all') end click_link('Download All') zip_file_should_exist end it "can save them in his dropbox account", js: true do user_decides_to_export_visit_images within(:css, 'div#visit_export') do expect(page).to have_css('#dropbox-btn') end end end