Sha256: d6da8a221518f0e64357010d6c0abcd2049c25401a782c15df3c0b0ba16b4310

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

require "spec_helper"

feature "csv import and export" do

  before do
    visit "/static_blocks"
    click_link "New snippet"
    fill_in "Title", :with => "foo"
    fill_in "Content", :with => "english bar"
    click_button "Submit"
  end

  scenario "can download a default csv before a translation" do
    click_link "Export snippets"
    page.should have_content("id,title,content,status,created_at,updated_at")
    page.should have_content("1,foo,english bar,published,")
  end

  context "after a translation" do
    before do
      visit "/static_blocks"
      click_link "wk"
      click_link "Edit"
      fill_in "snippet_content", :with => "wookie bar"
      click_button "Submit"
    end

    scenario "the original static block fields will be changed after a translation" do
      click_link "Export snippets"
      page.should have_content("id,title,content,status,created_at,updated_at")
      page.should have_content("1,foo,wookie bar,published,")
    end

    scenario "can download translations csv" do
      click_link "Export translations"
      page.should have_content("id,static_blocks_snippet_id,locale,content,created_at,updated_at")
      page.should have_content("1,1,en,english bar,")
      page.should have_content("2,1,wk,wookie bar,")
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
static_blocks-1.2.1 spec/integration/import_export_spec.rb
static_blocks-1.2.0 spec/integration/import_export_spec.rb
static_blocks-1.1.5 spec/integration/import_export_spec.rb
static_blocks-1.1.4 spec/integration/import_export_spec.rb
static_blocks-1.1.3 spec/integration/import_export_spec.rb
static_blocks-1.1.2 spec/integration/import_export_spec.rb
static_blocks-1.1.1 spec/integration/import_export_spec.rb
static_blocks-1.1.0 spec/integration/import_export_spec.rb
static_blocks-1.0.3 spec/integration/import_export_spec.rb
static_blocks-1.0.2 spec/integration/import_export_spec.rb