forked from publify/publify
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Feature Scenario 1 Semi-Complete #27
Open
knaydee
wants to merge
25
commits into
Ada-C4:master
Choose a base branch
from
knaydee:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
1a394c6
Cucumber tests for category bug
knaydee 04dee87
Add pry gem
knaydee 2d27732
Update paths for admin page
knaydee d7825ec
fix new or edit method using case - where if id is nill create a new …
knaydee a58edb8
working cucumber tests for clicking Categories link on admin panel
knaydee caede3b
passing rspec test for clicking on categories link on admin panel
knaydee ba17a52
cucumber test for creating a new category
knaydee 6bfd744
cucumber test to check if category count increases by 1 when new cate…
knaydee 2119aa1
modify cucumber category scenario to test edit
knaydee 72f97da
modify category new rspec
knaydee 50f9816
modify new category rspec
knaydee 4608971
Edits made to categories controller spec and web steps suggested by Kari
knaydee 074dd6c
cucumber test for not admin
knaydee 0545fd9
cucumber test for not admin and on the new article page
knaydee 2e9314e
cucumber test that non admins should not see merge_with field
knaydee 5094111
cucumber scenario passes when admin is logged in and cannot see merge…
knaydee 6380488
cucumber scenario for admin being able to see merge field, need to ad…
knaydee f5e254d
non admins are not allowed to edit - scenario passes
knaydee edeef0c
merge articles does not show on new article page - scenario passes
knaydee 7f5f30e
scenarios written for seeing merge articles on edit article page as a…
knaydee 2b63436
remove scenario for merge articles on edit page as it was a duplicate
knaydee 4dbe73d
Test text that only shows when an admin user is logged in
knaydee 0598dc2
scenarios that I thought were testing what I wanted tested are fixed …
knaydee deccf7e
text 'Merge Articles' only shows up on edit view for admins only, all…
knaydee 732bcef
category edit page path
knaydee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Feature: Manage Articles | ||
In order to organize articles | ||
As an admin | ||
I want to add a new category | ||
|
||
Background: | ||
Given the blog is set up | ||
And I am logged into the admin panel | ||
|
||
Scenario: Create category page is shown | ||
Given I am on the admin page | ||
When I follow "Categories" | ||
Then I should be on the new or edit category page |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Feature: Manage Categories | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These scenarios are nicely set up |
||
In order to better organize articles | ||
As an admin | ||
I want to add or edit a category | ||
|
||
Background: | ||
Given the blog is set up | ||
And I am logged into the admin panel | ||
|
||
Scenario: Category page is shown | ||
Given I am on the admin page | ||
When I follow "Categories" | ||
Then I should be on the category page | ||
|
||
Scenario: Create and edit category | ||
Given I am on the category page | ||
When I fill in "category_name" with "mishmash" | ||
And I press "Save" | ||
Then I should see "Category was successfully saved." | ||
And I should see "mishmash" | ||
And I should have 1 new category | ||
When I follow "mishmash" | ||
Then I should see "mishmash" |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Feature: Merge articles | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These scenarios are nicely set up. What do you think you'd want to add once the merge was fully implemented? |
||
As a blog administrator | ||
In order to improve UX | ||
I want to be able to merge articles with other similar articles | ||
|
||
Background: | ||
Given the blog is set up | ||
|
||
Scenario: Merge articles form is not shown on new article view | ||
Given I am on the admin page | ||
And I am logged into the admin panel | ||
When I follow "New Article" | ||
Then I should not see "Merge Articles" | ||
|
||
Scenario: Merge articles field is not shown for non admins | ||
Given I am on the admin content page | ||
And I am logged into the admin panel as a non admin | ||
When I follow "Edit" | ||
Then I should be on the admin content page | ||
And I should see "Error, you are not allowed to perform this action" | ||
|
||
Scenario: Merge articles field is shown for admins | ||
Given I am on the admin content page | ||
And I am logged into the admin panel | ||
When I follow "Edit" | ||
Then I should see "Merge Articles" |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,12 @@ def with_scope(locator) | |
:profile_id => 1, | ||
:name => 'admin', | ||
:state => 'active'}) | ||
User.create!({:login => 'not admin', | ||
:password => 'bbbbb', | ||
:email => '[email protected]', | ||
:profile_id => 2, | ||
:name => 'not admin', | ||
:state => 'active'}) | ||
end | ||
|
||
And /^I am logged into the admin panel$/ do | ||
|
@@ -55,6 +61,26 @@ def with_scope(locator) | |
end | ||
end | ||
|
||
And /^I am logged into the admin panel as a non admin$/ do | ||
visit '/accounts/login' | ||
fill_in 'user_login', :with => 'not admin' | ||
fill_in 'user_password', :with => 'bbbbb' | ||
click_button 'Login' | ||
if page.respond_to? :should | ||
page.should have_content('Login successful') | ||
else | ||
assert page.has_content?('Login successful') | ||
end | ||
end | ||
|
||
# And /^I am not an admin$/ do | ||
# User.name != 'admin' | ||
# end | ||
# | ||
# And /^I am an admin$/ do | ||
# User.name == 'admin' | ||
# end | ||
|
||
# Single-line step scoper | ||
When /^(.*) within (.*[^:])$/ do |step, parent| | ||
with_scope(parent) { When step } | ||
|
@@ -162,6 +188,12 @@ def with_scope(locator) | |
end | ||
end | ||
|
||
Then /^I should have (\d+) new category$/ do |count| | ||
# expect{Category.count}.to change{Category.count}.by(arg1) | ||
Category.count.should == count.to_i + 1 | ||
end | ||
|
||
|
||
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value| | ||
with_scope(parent) do | ||
field = find_field(field) | ||
|
@@ -250,7 +282,7 @@ def with_scope(locator) | |
end | ||
end | ||
end | ||
|
||
Then /^(?:|I )should be on (.+)$/ do |page_name| | ||
current_path = URI.parse(current_url).path | ||
if current_path.respond_to? :should | ||
|
@@ -264,8 +296,8 @@ def with_scope(locator) | |
query = URI.parse(current_url).query | ||
actual_params = query ? CGI.parse(query) : {} | ||
expected_params = {} | ||
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} | ||
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} | ||
|
||
if actual_params.respond_to? :should | ||
actual_params.should == expected_params | ||
else | ||
|
This file contains 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 characters
This file contains 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 characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature is in-progess/copy-paste from the categories one, correct?