next cuke, fix old
This commit is contained in:
parent
09704291e9
commit
5d5fa084e5
6 changed files with 33 additions and 5 deletions
|
|
@ -39,3 +39,7 @@ When /^I should see "([^"]*)" aspect unselected$/ do |aspect_name|
|
|||
page.has_css?("li[data-aspect_id='#{aspect.id}']:not(.active)").should be_true
|
||||
end
|
||||
end
|
||||
|
||||
When /^"([^"]*)" should render with the "([^"]*)" template$/ do |post_text, template_name|
|
||||
within find_post_by_text(post_text) { assert_template(template_name) }
|
||||
end
|
||||
|
|
@ -25,18 +25,26 @@ def finalize_frame
|
|||
click_button "done"
|
||||
end
|
||||
|
||||
def post_div
|
||||
find(".post")
|
||||
end
|
||||
|
||||
def within_frame_preview
|
||||
within ".post-view .post" do
|
||||
within post_div do
|
||||
yield
|
||||
end
|
||||
end
|
||||
|
||||
def assert_template(template_name)
|
||||
post_div["data-template"].should == template_name
|
||||
end
|
||||
|
||||
When /^I trumpet$/ do
|
||||
visit new_post_path
|
||||
end
|
||||
|
||||
When /^I write "([^"]*)"$/ do |text|
|
||||
fill_in :text, :with => text
|
||||
fill_in 'text', :with => text
|
||||
end
|
||||
|
||||
Then /I mention "([^"]*)"$/ do |text|
|
||||
|
|
@ -90,7 +98,14 @@ Then /^"([^"]*)" should have (\d+) pictures$/ do |post_text, number_of_pictures|
|
|||
find_post_by_text(post_text).all(".photo_attachments img").size.should == number_of_pictures.to_i
|
||||
end
|
||||
|
||||
|
||||
Then /^I should see "([^"]*)" in the framer preview$/ do |post_text|
|
||||
within_frame_preview { page.should have_content(post_text) }
|
||||
end
|
||||
|
||||
When /^I select the template "([^"]*)"$/ do |template_name|
|
||||
select template_name, :from => 'template'
|
||||
end
|
||||
|
||||
Then /^I should see an "([^"]*)" framer preview$/ do |template_name|
|
||||
assert_template(template_name)
|
||||
end
|
||||
|
|
@ -44,7 +44,10 @@ Feature: Creating a new post
|
|||
And I upload a fixture picture with filename "button.gif"
|
||||
And I start the framing process
|
||||
Then I should see "This is hella customized" in the framer preview
|
||||
When I select the template "awesome"
|
||||
Then I should see an "awesome" framer preview
|
||||
When I finalize my frame
|
||||
And I go to "/stream"
|
||||
Then "This is hella customized" should be post 1
|
||||
And "This is hella customized" should render with the "awesome" template
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,5 @@
|
|||
<div class="controls">
|
||||
<div class='template-picker'></div>
|
||||
<button class="done btn-primary">done</button>
|
||||
</div>
|
||||
<div class="post-view"></div>
|
||||
|
|
@ -8,7 +8,10 @@
|
|||
<legend>
|
||||
New Post
|
||||
</legend>
|
||||
<label>
|
||||
text
|
||||
<textarea class="text span8"/>
|
||||
</label>
|
||||
<textarea id="text_with_markup" style="display:none;"/>
|
||||
|
||||
<div class="aspect_selector"></div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue