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
require 'spec_helper' | |
describe 'users/user_details', type: :view do | |
it 'should render the user details view' do | |
form_builder = ActionView::Helpers::FormBuilder.new(:f, @user, self, {}, nil) | |
render :partial => 'users/user_details', locals: {f: form_builder} | |
# expectations | |
end |
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
<%= f.hidden_field :user_phone %> | |
<%= f.hidden_field :user_address %> | |
<div> | |
<ul> | |
<li> | |
User Address: <%= f.text_field :user_address %> | |
</li> | |
<li> | |
User Phone: <%= f.text_field :user_phone %> |
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
<%= nested_form_for @user do |f| %> | |
<%= render :partial => 'user_details', :locals => { :f => f } %> | |
<% end %> |
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
<!DOCTYPE html> | |
<html ng-app="myApp"> | |
<head> | |
<meta charset="utf-8"/> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js" | |
data-semver="1.0.8"></script> | |
<script src="app.js"></script> | |
</head> | |
<body ng-controller="OuterCtrl"> | |
<p>your input is being bind from model. Your Input is : {{name}}!</p> |
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
WebDriver driver=new ChromeDriver(); | |
driver.manage().window().maximize(); | |
driver.get("http://www.google.com"); | |
File src= ((TakesScreenshot)driver).getScreenshotAs("png"); |
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
@RestController | |
@RequestMapping("/reports") | |
public class ReportsController { | |
@RequestMapping(method = RequestMethod.GET) | |
public ResponseEntity getReport(HttpRequestServlet request) { | |
ReportGenerator reportGenerator = new ReportGenerator(request); | |
Report report = reportGenerator.createReport(); | |
// ... | |
return report; |
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
//.. Imports | |
public class ReportGenerator { | |
private final HttpServletRequest request; | |
private final WebDriver webDriver; | |
public ReportGenerator(HttpServletRequest request){ | |
this.request = request; | |
this.webDriver = new ChromeDriver(...); | |
} |
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
fun main() { | |
val s = Square(2.0) | |
println(s.area()) // Prints 4.0, duh! | |
println(s - Square(3.0)) // Prints -5.0, Sweet! | |
} | |
data class Square (val side: Double) { | |
operator fun minus(other: Square): Double { | |
return this.area() - other.area() | |
} |
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
class Library (var books: MutableList<Book>) { | |
fun getBooks(): MutableList<Book> { | |
... | |
} | |
fun setBooks(newBooks: MutableList<Book>) { | |
... | |
} | |
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
class Library (val books: MutableList<Book>) { | |
fun getBooks(): MutableList<Book> { | |
... | |
} | |
fun addBook(book: Book) { | |
... | |
} | |
} |
OlderNewer