Skip to content

Commit

Permalink
Remove Save & Publish button from Scheduler Edit Page
Browse files Browse the repository at this point in the history
fixes CNVS-20413

Test Plan:
 * Navigate to Scheduler
 * Click on "Create an Appointment Group"
 * Verify there is not a Save & Publish button
 * Verify the Save button is blue
 * Add the Appointment group to a course calendar and click the Save button
 * Verify the appointment is saved and
   displays on the list of appointment groups
 * Log in as a student in the course
 * Verify a student can see and interact with the appointment group

Change-Id: I493cd7ae2c8a88c4b3885aa959f6fa3782fc7184
Reviewed-on: https://gerrit.instructure.com/57879
Tested-by: Jenkins
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
  • Loading branch information
Steven Shepherd committed Jul 10, 2015
1 parent 5742c5d commit 597abe9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
4 changes: 1 addition & 3 deletions app/coffeescripts/calendar/EditAppointmentGroupDialog.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ define [
@parentCloseCB(saved)

show: =>

@appointmentGroupsForm = new EditAppointmentGroupDetails(dialog.find(".wrapper"), @apptGroup, @contexts, @closeCB)

buttons = if @apptGroup.workflow_state == 'active'
Expand All @@ -35,9 +36,6 @@ define [
else
[
text: I18n.t 'save', 'Save'
click: @appointmentGroupsForm.saveWithoutPublishingClick
,
text: I18n.t 'save_and_publish', 'Save & Publish'
class: 'btn-primary'
click: @appointmentGroupsForm.saveClick
]
Expand Down
18 changes: 2 additions & 16 deletions spec/selenium/calendar/calendar2_scheduler_teacher_crud_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,12 @@
make_full_screen
end

it "should create a new appointment group" do
get "/calendar2"
click_scheduler_link
create_appointment_group_manual
end

it "should create appointment group and go back and publish it", priority: "1", test_id: 85934 do
it "should create a new appointment group and automatically publish it", priority: "1", test_id: 85934 do
get "/calendar2"
click_scheduler_link

create_appointment_group_manual(:publish => false)
create_appointment_group_manual
new_appointment_group = AppointmentGroup.last
expect(new_appointment_group.workflow_state).to eq 'pending'
expect(f('.ag-x-of-x-signed-up')).to include_text('unpublished')
open_edit_dialog
edit_form = f('#edit_appointment_form')
keep_trying_until { expect(edit_form).to be_displayed }
f('.ui-dialog-buttonset .btn-primary').click
wait_for_ajaximations
new_appointment_group.reload
expect(new_appointment_group.workflow_state).to eq 'active'
end

Expand Down
4 changes: 2 additions & 2 deletions spec/selenium/calendar/calendar2_scheduler_teacher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@

# Need to submit manually to avoid waiting for ajaximations, which
# causes Selenium to blow up when it sees the alert we're expecting
_, save_and_publish = ff('.ui-dialog-buttonset .ui-button')
save_and_publish.click
save = f('.ui-dialog-buttonset .ui-button')
save.click

expect(driver.switch_to.alert.text).to be_present
driver.switch_to.alert.accept
Expand Down
12 changes: 3 additions & 9 deletions spec/selenium/helpers/scheduler_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,19 @@ def fill_out_appointment_group_form(new_appointment_text, opts = {})
replace_content(edit_form.find_element(:css, '.end_time'), '3')
end

def submit_appointment_group_form(publish = true)
save, save_and_publish = ff('.ui-dialog-buttonset .ui-button')
if publish
save_and_publish.click
else
save.click
end
def submit_appointment_group_form
f('.ui-dialog-buttonset .ui-button').click
wait_for_ajaximations
end

def create_appointment_group_manual(opts = {})
opts = {
:publish => true,
:new_appointment_text => 'new appointment group'
}.with_indifferent_access.merge(opts)

expect {
fill_out_appointment_group_form(opts[:new_appointment_text], opts)
submit_appointment_group_form(opts[:publish])
submit_appointment_group_form
expect(f('.view_calendar_link').text).to eq opts[:new_appointment_text]
}.to change(AppointmentGroup, :count).by(1)
end
Expand Down

0 comments on commit 597abe9

Please sign in to comment.